diff --git a/pyproject.toml b/pyproject.toml index 15176f6c7..4defa2772 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,8 +49,16 @@ include = ["aider*", "aider.website"] [tool.setuptools.exclude-package-data] "aider.website" = [ # [[[cog -# print("\n".join(f' "{pat}",' for pat in exclude_website_pats)) +# cog.out("\n".join(f' "{pat}",' for pat in exclude_website_pats)) # ]]] +"examples/**", +"_posts/**", +"HISTORY.md", +"docs/benchmarks*md", +"docs/ctags.md", +"docs/unified-diffs.md", +"docs/leaderboards/index.md", +"assets/**", # [[[end]]] ] diff --git a/scripts/versionbump.py b/scripts/versionbump.py index 5902b2c91..f66cc322c 100755 --- a/scripts/versionbump.py +++ b/scripts/versionbump.py @@ -12,22 +12,11 @@ from packaging import version def check_cog_pyproject(): - with tempfile.NamedTemporaryFile(mode="w+", delete=False) as temp_file: - with open("pyproject.toml", "r") as original_file: - temp_file.write(original_file.read()) - - result = subprocess.run(["cog", "-r", "pyproject.toml"], capture_output=True, text=True) + result = subprocess.run(["cog", "--check", "pyproject.toml"], capture_output=True, text=True) if result.returncode != 0: - print("Error: cog -r pyproject.toml failed with the following output:") - print(result.stderr) - sys.exit(1) - - if not filecmp.cmp("pyproject.toml", temp_file.name): - print( - "Error: cog -r pyproject.toml has changed the file. Please run cog -r pyproject.toml" - " and commit the changes." - ) + print("Error: cog --check pyproject.toml failed, updating.") + subprocess.run(["cog", "-r", "pyproject.toml"]) sys.exit(1) @@ -94,10 +83,10 @@ def main(): dry_run = args.dry_run # Perform checks before proceeding + check_cog_pyproject() check_branch() check_working_directory_clean() check_main_branch_up_to_date() - check_cog_pyproject() new_version_str = args.new_version if not re.match(r"^\d+\.\d+\.\d+$", new_version_str):