mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-12-01 05:37:16 +08:00
Resolve the Pydantic model conflict using annotation-only field definitions and preserve the typed TypeForm cast. Regenerate the workspace lock and requirements exports for the merged dependencies.
115 lines
3.4 KiB
Makefile
115 lines
3.4 KiB
Makefile
# Location of virtualenv used for development.
|
|
VENV?=.venv
|
|
# Open resource on Mac OS X or Linux
|
|
OPEN_RESOURCE=bash -c 'open $$0 || xdg-open $$0'
|
|
# Source virtualenv to execute command (flake8, sphinx, twine, etc...)
|
|
IN_VENV=if [ -f $(VENV)/bin/activate ]; then . $(VENV)/bin/activate; fi;
|
|
UPSTREAM?=galaxyproject
|
|
SOURCE_DIR?=src/galaxy
|
|
BUILD_SCRIPTS_DIR=scripts
|
|
DEV_RELEASE?=0
|
|
VERSION?=$(shell DEV_RELEASE=$(DEV_RELEASE) python $(BUILD_SCRIPTS_DIR)/print_version_for_release.py)
|
|
PROJECT_NAME?=galaxy-$(shell basename $(CURDIR))
|
|
PROJECT_NAME:=$(subst _,-,$(PROJECT_NAME))
|
|
# Distribution name used to scope uv to this package in the single root
|
|
# workspace. packages/meta builds the published `galaxy` distribution,
|
|
# not `galaxy-meta`, hence the special case.
|
|
ifeq ($(shell basename $(CURDIR)),meta)
|
|
UV_PACKAGE?=galaxy
|
|
else
|
|
UV_PACKAGE?=$(PROJECT_NAME)
|
|
endif
|
|
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
|
|
|
|
help:
|
|
@echo "clean - remove all build, test, coverage and Python artifacts"
|
|
@echo "clean-build - remove build artifacts"
|
|
@echo "clean-pyc - remove Python file artifacts"
|
|
@echo "clean-test - remove test and coverage artifacts"
|
|
@echo "setup-venv - setup a development virtualenv in current directory."
|
|
@echo "lint-dist - twine check dist results, including validating README content"
|
|
@echo "dist - package project for PyPI distribution"
|
|
|
|
clean: clean-build clean-pyc clean-tests
|
|
|
|
clean-build:
|
|
rm -fr build/
|
|
rm -fr $(DIST)/
|
|
find . -name "*.egg-info" -type d -exec rm -rf {} +
|
|
|
|
clean-pyc:
|
|
find . -name '*.pyc' -exec rm -f {} +
|
|
find . -name '*.pyo' -exec rm -f {} +
|
|
find . -name '*~' -exec rm -f {} +
|
|
find . -name '__pycache__' -exec rm -fr {} +
|
|
|
|
clean-tests:
|
|
rm -fr .tox/
|
|
|
|
setup-venv:
|
|
# Resolves the single root workspace (the nested packages/pyproject.toml
|
|
# workspace was removed), scoped to this package. --inexact preserves the
|
|
# mypy/lint tool installs below across re-syncs.
|
|
uv sync --locked --inexact --package $(UV_PACKAGE) --all-extras
|
|
|
|
_test:
|
|
uv run --locked --package $(UV_PACKAGE) pytest $(TESTS)
|
|
|
|
test: setup-venv _test
|
|
|
|
_dist:
|
|
uv build -o $(DIST)
|
|
ls -l $(DIST)
|
|
|
|
dist: clean _dist
|
|
|
|
_setup-mypy-venv: setup-venv
|
|
uv pip install -r ../../lib/galaxy/dependencies/pinned-typecheck-requirements.txt
|
|
|
|
_mypy:
|
|
uv run --locked --package $(UV_PACKAGE) mypy .
|
|
|
|
mypy: _setup-mypy-venv _mypy
|
|
|
|
_setup-lint-venv: setup-venv
|
|
uv pip install -r ../../lib/galaxy/dependencies/pinned-lint-requirements.txt
|
|
|
|
_lint:
|
|
uv run --locked --package $(UV_PACKAGE) ruff check .
|
|
|
|
lint: _setup-lint-venv _lint
|
|
|
|
lint-dist:
|
|
uvx --with-requirements dev-requirements.txt --from twine twine check $(DIST)/*
|
|
|
|
# black doesn't actually work on symlinked files because they are outside
|
|
# the current directory
|
|
|
|
#_setup-format-venv: setup-venv
|
|
# uv pip install isort black
|
|
#_isort:
|
|
# uv run isort --sp ../../.isort.cfg .
|
|
#_black:
|
|
# uv run black --config ../pyproject.toml .
|
|
#format: _setup-format-venv _isort _black
|
|
|
|
commit-version:
|
|
$(IN_VENV) DEV_RELEASE=$(DEV_RELEASE) python $(BUILD_SCRIPTS_DIR)/commit_version.py $(VERSION)
|
|
|
|
new-version:
|
|
$(IN_VENV) DEV_RELEASE=$(DEV_RELEASE) python $(BUILD_SCRIPTS_DIR)/new_version.py $(VERSION)
|
|
|
|
release-local: commit-version release-artifacts new-version
|
|
|
|
push-release:
|
|
# git push $(UPSTREAM) $(BRANCH)
|
|
# git push upstream $(PROJECT_NAME)-$(VERSION)
|
|
echo "Makefile doesn't manually push release."
|
|
|
|
release: release-local push-release
|