Skip to content

Commit b5096ff

Browse files
authored
fix: the generated build epoch belongs to the generated wheel, and thus both files should be generated using the same recipe (#1126)
Refs: 260075b
1 parent bfd57d7 commit b5096ff

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

Makefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,17 @@ test-all: test-unit test-integration test-performance
182182
# When building these artifacts, we need the environment variable SOURCE_DATE_EPOCH
183183
# set to the build date/epoch. For more details, see: https://flit.pypa.io/en/latest/reproducible.html
184184
.PHONY: dist
185-
dist: dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any.whl dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-docs-html.zip dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-docs-md.zip dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-build-epoch.txt
186-
dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any.whl: check test-all dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-build-epoch.txt
185+
dist: dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any.whl dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-docs-html.zip dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-docs-md.zip
186+
dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any.whl: check test-all
187187
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) python -m flit build --setup-py --format wheel
188-
dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz: check test-all dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-build-epoch.txt
188+
echo $(SOURCE_DATE_EPOCH) > dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any-build-epoch.txt
189+
dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz: check test-all
189190
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) python -m flit build --no-setup-py --format sdist
190191
dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-docs-html.zip: docs-html
191192
python -m zipfile -c dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-docs-html.zip docs/_build/html/
192193
dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-docs-md.zip: docs-md
193194
python -m zipfile -c dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-docs-md.zip docs/_build/markdown/
194195

195-
# Keep this goal phony to ensure the epoch is always updated.
196-
.PHONY: dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-build-epoch.txt
197-
dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-build-epoch.txt:
198-
echo $(SOURCE_DATE_EPOCH) > dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-build-epoch.txt
199-
200196
# Build a PEP-503 compatible Simple Repository directory inside of dist/. For details on
201197
# the layout of that directory and the normalized project name, see: https://peps.python.org/pep-0503/
202198
# The directory can then be used to install (hashed) artifacts by using `pip` and

0 commit comments

Comments
 (0)