Merge pull request #22413 from nsoranzo/fix_lint-dist

[26.0] Fix running twine commands in package Makefiles
This commit is contained in:
Marius van den Beek
2026-04-08 17:28:03 +02:00
committed by GitHub
4 changed files with 38 additions and 60 deletions
+1 -1
View File
@@ -1 +1 @@
22.13.0
22.20.0
+1 -2
View File
@@ -1,7 +1,6 @@
# For dev
sphinx
mypy
# For release
build
twine
twine==6.2.0
+9 -24
View File
@@ -31,7 +31,7 @@ clean: clean-build clean-pyc clean-tests
clean-build:
rm -fr build/
rm -fr dist/
rm -fr $(DIST)/
rm -fr galaxy_*.egg-info
clean-pyc:
@@ -44,15 +44,15 @@ clean-tests:
rm -fr .tox/
setup-venv:
uv sync --all-extras
uv sync --inexact --all-extras
_test:
_test:
uv run pytest $(TESTS)
test: setup-venv _test
_dist:
uv build --out-dir $(DIST)
uv build -o $(DIST)
ls -l $(DIST)
dist: setup-venv clean _dist
@@ -65,8 +65,6 @@ _mypy:
mypy: _setup-mypy-venv _mypy
_twine-exists: ; @which twine > /dev/null
_setup-lint-venv: setup-venv
uv pip install -r ../../lib/galaxy/dependencies/pinned-lint-requirements.txt
@@ -75,8 +73,11 @@ _lint:
lint: _setup-lint-venv _lint
lint-dist: _twine-exists dist
$(IN_VENV) twine check dist/*
_setup-dev-venv:
uv pip install -r dev-requirements.txt
lint-dist: _setup-dev-venv
uv run twine check $(DIST)/*
# black doesn't actually work on symlinked files because they are outside
# the current directory
@@ -89,22 +90,6 @@ lint-dist: _twine-exists dist
# uv run black --config ../pyproject.toml .
#format: _setup-format-venv _isort _black
_release-test-artifacts:
$(IN_VENV) twine upload -r test dist/*
$(OPEN_RESOURCE) https://testpypi.python.org/pypi/$(PROJECT_NAME)
release-test-artifacts: lint-dist _release-test-artifacts
_release-artifacts:
@while [ -z "$$CONTINUE" ]; do \
read -r -p "Have you executed release-test and reviewed results? [y/N]: " CONTINUE; \
done ; \
[ $$CONTINUE = "y" ] || [ $$CONTINUE = "Y" ] || (echo "Exiting."; exit 1;)
@echo "Releasing"
$(IN_VENV) twine upload dist/*
release-artifacts: release-test-artifacts _release-artifacts
commit-version:
$(IN_VENV) DEV_RELEASE=$(DEV_RELEASE) python $(BUILD_SCRIPTS_DIR)/commit_version.py $(VERSION)
+27 -33
View File
@@ -13,6 +13,7 @@ PROJECT_NAME?=galaxy-$(shell basename $(CURDIR))
PROJECT_NAME:=$(subst _,-,$(PROJECT_NAME))
BRANCH?=$(shell git rev-parse --abbrev-ref HEAD)
TEST_DIR?=tests
DIST=dist
TESTS?=$(SOURCE_DIR) $(TEST_DIR)
.PHONY: clean-pyc clean-build docs clean
@@ -30,7 +31,7 @@ clean: clean-build clean-pyc clean-tests clean-web-client
clean-build:
rm -fr build/
rm -fr dist/
rm -fr $(DIST)/
rm -fr galaxy_*.egg-info
clean-pyc:
@@ -48,46 +49,42 @@ clean-web-client:
rm -rf galaxy/web_client/dist galaxy/web_client/client_build_hash.txt
setup-venv:
if [ ! -d $(VENV) ]; then python -m venv $(VENV); exit; fi;
$(IN_VENV) pip install -r dev-requirements.txt
uv sync --inexact --all-extras
test:
$(IN_VENV) pytest $(TESTS)
_test:
uv run pytest $(TESTS)
dist: clean $(VENV)/bin/yarn galaxy/web_client/client_build_hash.txt
$(IN_VENV) python -m build
ls -l dist
test: setup-venv _test
$(VENV)/bin/yarn: setup-venv
$(IN_VENV) pip install build nodeenv
$(IN_VENV) nodeenv -n $(shell cat ../../client/.node_version) -p
$(IN_VENV) npm install --global yarn
_dist: galaxy/web_client/client_build_hash.txt
uv build -o $(DIST)
ls -l $(DIST)
dist: clean _dist
galaxy/web_client/client_build_hash.txt:
$(IN_VENV) cd ../..; make client-production
mv ../../client/dist galaxy/web_client
# Use the main Galaxy virtualenv, since that's what `make client-production` uses
cd ../..; \
uv venv --allow-existing $(VENV); \
$(IN_VENV) \
uv pip install "nodejs-wheel==$$(cat client/.node_version)"; \
make client-production
mv ../../client/dist galaxy/web_client/
git rev-parse HEAD > galaxy/web_client/client_build_hash.txt
_twine-exists: ; @which twine > /dev/null
_setup-mypy-venv: setup-venv
uv pip install -r ../../lib/galaxy/dependencies/pinned-typecheck-requirements.txt
lint-dist: _twine-exists dist
$(IN_VENV) twine check dist/*
_mypy:
uv run mypy .
_release-test-artifacts:
$(IN_VENV) twine upload -r test dist/*
$(OPEN_RESOURCE) https://testpypi.python.org/pypi/$(PROJECT_NAME)
mypy: _setup-mypy-venv _mypy
release-test-artifacts: lint-dist _release-test-artifacts
_setup-dev-venv:
uv pip install -r dev-requirements.txt
_release-artifacts:
@while [ -z "$$CONTINUE" ]; do \
read -r -p "Have you executed release-test and reviewed results? [y/N]: " CONTINUE; \
done ; \
[ $$CONTINUE = "y" ] || [ $$CONTINUE = "Y" ] || (echo "Exiting."; exit 1;)
@echo "Releasing"
$(IN_VENV) twine upload dist/*
release-artifacts: release-test-artifacts _release-artifacts
lint-dist: _setup-dev-venv
uv run twine check $(DIST)/*
commit-version:
$(IN_VENV) DEV_RELEASE=$(DEV_RELEASE) python $(BUILD_SCRIPTS_DIR)/commit_version.py $(VERSION)
@@ -103,6 +100,3 @@ push-release:
echo "Makefile doesn't manually push release."
release: release-local push-release
mypy:
mypy .