diff --git a/constraints.txt b/constraints.txt deleted file mode 100644 index e9f6da3..0000000 --- a/constraints.txt +++ /dev/null @@ -1 +0,0 @@ -wheel==0.44.0 diff --git a/dist/SHA256SUMS b/dist/SHA256SUMS index ca0ab09..1c5e5ff 100644 --- a/dist/SHA256SUMS +++ b/dist/SHA256SUMS @@ -1,2 +1,2 @@ -f12e5d9d8bfd39e33e4774e1ecfea5a084c7683dd3088d192902ebabca7d4141 reproducibly-0.0.11-py3-none-any.whl -e5b873bab5cf10bc9e1a3cb925b9053c4136f9309190d636ee6d6b2aef4e1c95 reproducibly-0.0.11.tar.gz +c69f6940be8ccec22f5ad22ffac310818d2f155b432cfec79366a175ed0d86e0 reproducibly-0.0.11-py3-none-any.whl +175fee2ef6f1ea565bd8756773766765fd5ddf911ac27442bcc700d38e51de30 reproducibly-0.0.11.tar.gz diff --git a/reproducibly.py b/reproducibly.py index 8963f45..fc414e9 100644 --- a/reproducibly.py +++ b/reproducibly.py @@ -33,7 +33,6 @@ from build.env import DefaultIsolatedEnv from cibuildwheel.__main__ import build_in_directory from cibuildwheel.options import CommandLineArguments -from packaging.requirements import Requirement from pyproject_hooks import default_subprocess_runner # [[[cog import cog ; from pathlib import Path ]]] @@ -72,15 +71,6 @@ EARLIEST = datetime(1980, 1, 1, 0, 0, 0).timestamp() # 315532800.0 -CONSTRAINTS = { - # [[[cog - # for line in Path("constraints.txt").read_text().splitlines(): - # cog.outl(f'"{line}",') - # ]]] - "wheel==0.44.0", - # [[[end]]] -} - __version__ = "0.0.11" @@ -96,8 +86,8 @@ def _build( srcdir, runner=default_subprocess_runner, ) - env.install(override(builder.build_system_requires)) - env.install(override(builder.get_requires_for_build(distribution))) + env.install(builder.build_system_requires) + env.install(builder.get_requires_for_build(distribution)) built = builder.build(distribution, output) return output / built @@ -112,14 +102,12 @@ def _cibuildwheel(sdist: Path, output: Path) -> Path: """Call the cibuildwheel API Returns the path to the built distribution""" - filename = Path("constraints.txt") with ( ModifiedEnvironment( - CIBW_DEPENDENCY_VERSIONS=str(filename), CIBW_BUILD_FRONTEND="build", CIBW_CONTAINER_ENGINE="podman", CIBW_ENVIRONMENT_PASS_LINUX="SOURCE_DATE_EPOCH", - CIBW_ENVIRONMENT=f"PIP_TIMEOUT=150 PIP_CONSTRAINT=/{filename}", + CIBW_ENVIRONMENT="PIP_TIMEOUT=150", ), TemporaryDirectory() as directory, ): @@ -129,7 +117,6 @@ def _cibuildwheel(sdist: Path, output: Path) -> Path: args.output_dir = Path(directory).resolve() args.platform = None with chdir(directory): # output maybe a relative path - filename.write_text("\n".join(CONSTRAINTS) + "\n") build_in_directory(args) wheel = next(args.output_dir.glob("*.whl")) output.joinpath(wheel.name).unlink(missing_ok=True) @@ -257,16 +244,6 @@ def key(input_: bytes | ZipInfo) -> tuple[int, list[str | list]]: return (group, breadth_first_key(item)) -def override(before: set[str], constraints: set[str] = CONSTRAINTS) -> set[str]: - """Replace certain requirements from constraints""" - after = set() - for replacement in constraints: - name = Requirement(replacement).name - for i in before: - after.add(replacement if Requirement(i).name == name else i) - return after - - def zipumask(path: Path, umask: int = 0o022) -> Path: """Apply a umask to a zip file at path diff --git a/reproducibly_test.py b/reproducibly_test.py index 4f25d03..c342221 100644 --- a/reproducibly_test.py +++ b/reproducibly_test.py @@ -30,7 +30,6 @@ latest_modification_time, main, ModifiedEnvironment, - override, parse_args, zipumask, ) @@ -150,16 +149,6 @@ def test_basic(self): self.assertEqual(result, str(int(latest))) -class TestOverride(unittest.TestCase): - def test_overridden_with_specific_version(self): - result = override({"example"}, {"example==1.2.3"}) - self.assertEqual(result, {"example==1.2.3"}) - - def test_unchanged(self): - result = override({"example"}, {"other==1.2.3"}) - self.assertEqual(result, {"example"}) - - class TestZipumask(unittest.TestCase): def test_basic(self): with TemporaryDirectory() as tmpdir: