Skip to content

Commit 1a09d95

Browse files
committed
fix: make the generated Simple Index (see PEP 503) better navigatable
1 parent 8d1285c commit 1a09d95

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ PROJECT_NAME := $(shell python -c $$'import re; print(re.sub(r"[-_.]+", "-", "$(
212212
.PHONY: simple-index
213213
simple-index: dist/$(PACKAGE_WHEEL_NAME) dist/$(PACKAGE_SDIST_NAME)
214214
mkdir -p dist/simple-index/$(PROJECT_NAME)
215-
echo -e "<!-- https://peps.python.org/pep-0503/ -->\n<!DOCTYPE html><html lang='en'><head><meta name='pypi:repository-version' content='1.3'><title>Simple Index</title></head><body><a href='/$(PACKAGE_NAME)/'>$(PACKAGE_NAME)</a></body></html>" > dist/simple-index/index.html
216-
echo -e "<!-- https://peps.python.org/pep-0503/ -->\n<!DOCTYPE html><html lang='en'><head><meta name='pypi:repository-version' content='1.3'><title>Simple Index: $(PROJECT_NAME)</title></head><body><a href='$(PACKAGE_WHEEL_NAME)#sha256="$$(python -c "with open('dist/$(PACKAGE_WHEEL_NAME)', 'rb') as f: import hashlib; print(hashlib.sha256(f.read()).hexdigest());")"'>$(PACKAGE_WHEEL_NAME)</a><a href='$(PACKAGE_SDIST_NAME)#sha256="$$(python -c "with open('dist/$(PACKAGE_SDIST_NAME)', 'rb') as f: import hashlib; print(hashlib.sha256(f.read()).hexdigest());")"'>$(PACKAGE_SDIST_NAME)</a></body></html>" > dist/simple-index/$(PROJECT_NAME)/index.html
215+
echo -e "<!-- https://peps.python.org/pep-0503/ -->\n<!DOCTYPE html><html lang='en'><head><meta name='pypi:repository-version' content='1.3'><title>Simple Index</title></head><body><a href='$(PACKAGE_NAME)/index.html'>$(PACKAGE_NAME)</a></body></html>" > dist/simple-index/index.html
216+
echo -e "<!-- https://peps.python.org/pep-0503/ -->\n<!DOCTYPE html><html lang='en'><head><meta name='pypi:repository-version' content='1.3'><title>Simple Index: $(PROJECT_NAME)</title></head><body><ul><li><a href='$(PACKAGE_WHEEL_NAME)#sha256="$$(python -c "with open('dist/$(PACKAGE_WHEEL_NAME)', 'rb') as f: import hashlib; print(hashlib.sha256(f.read()).hexdigest());")"'>$(PACKAGE_WHEEL_NAME)</a> epoch: $(SOURCE_DATE_EPOCH)</li><li><a href='$(PACKAGE_SDIST_NAME)#sha256="$$(python -c "with open('dist/$(PACKAGE_SDIST_NAME)', 'rb') as f: import hashlib; print(hashlib.sha256(f.read()).hexdigest());")"'>$(PACKAGE_SDIST_NAME)</a></li></ul></body></html>" > dist/simple-index/$(PROJECT_NAME)/index.html
217217
cp -f dist/$(PACKAGE_WHEEL_NAME) dist/simple-index/$(PROJECT_NAME)/
218218
cp -f dist/$(PACKAGE_SDIST_NAME) dist/simple-index/$(PROJECT_NAME)/
219219
python -m tarfile --create dist/$(PACKAGE_BASE_NAME)-pep503-simple-index.tar dist/simple-index/

0 commit comments

Comments
 (0)