forked from langchain-ai/langchain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3,376 changed files
with
208,914 additions
and
303,802 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import sys | ||
import tomllib | ||
|
||
if __name__ == "__main__": | ||
# Get the TOML file path from the command line argument | ||
toml_file = sys.argv[1] | ||
|
||
# read toml file | ||
with open(toml_file, "rb") as file: | ||
toml_data = tomllib.load(file) | ||
|
||
# see if we're releasing an rc | ||
version = toml_data["tool"]["poetry"]["version"] | ||
releasing_rc = "rc" in version | ||
|
||
# if not, iterate through dependencies and make sure none allow prereleases | ||
if not releasing_rc: | ||
dependencies = toml_data["tool"]["poetry"]["dependencies"] | ||
for lib in dependencies: | ||
dep_version = dependencies[lib] | ||
dep_version_string = ( | ||
dep_version["version"] if isinstance(dep_version, dict) else dep_version | ||
) | ||
|
||
if "rc" in dep_version_string: | ||
raise ValueError( | ||
f"Dependency {lib} has a prerelease version. Please remove this." | ||
) | ||
|
||
if isinstance(dep_version, dict) and dep_version.get( | ||
"allow-prereleases", False | ||
): | ||
raise ValueError( | ||
f"Dependency {lib} has allow-prereleases set to true. Please remove this." | ||
) |
Oops, something went wrong.