From d83926913d01922d4c204ab7fe1053b4c1918233 Mon Sep 17 00:00:00 2001 From: Ayala Shachar Date: Fri, 4 Oct 2024 12:28:16 +0300 Subject: [PATCH] Use UV & support python >= 3.8, <= 3.13 --- .github/workflows/main.yml | 25 +++++++++++++++---------- Makefile | 14 +++++--------- doc/changelog.rst | 2 ++ pyproject.toml | 4 ++-- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d10b814..d634cbf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,17 +11,22 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + env: + UV_PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Checkout the repository + uses: actions/checkout@main + - name: Install the default version of uv + id: setup-uv + uses: astral-sh/setup-uv@v3 + - name: Print the installed version + run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" + - name: Install Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - name: Tests run: | - python -m venv .env - .env/bin/pip install -U setuptools pip - .env/bin/pip install '.[testing]' - .env/bin/pytest tests + uv venv + uv pip install ".[testing]" + .venv/bin/pytest tests diff --git a/Makefile b/Makefile index b69eeb6..87360d7 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,11 @@ default: test test: env - .env/bin/pytest -x tests + .venv/bin/pytest -x tests -env: .env/.up-to-date +env: + uv venv + uv pip install -e ".[testing,doc]" doc: env - .env/bin/sphinx-build -a -W -E doc build/sphinx/html - -.env/.up-to-date: pyproject.toml - python -m venv .env - .env/bin/pip install -e '.[testing,doc]' - touch $@ - + .venv/bin/sphinx-build -a -W -E doc build/sphinx/html diff --git a/doc/changelog.rst b/doc/changelog.rst index 533fa88..2d43185 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -1,6 +1,8 @@ Changelog ========= +* :feature:`-` Support python versions: >= 3.8, <= 3.13 +* :feature:`-` Use UV in CI * :feature:`-` Use `pyproject.toml` from package configuration * :feature:`-` Move CI to GitHub Actions (from Travis CI) * :feature:`-` Support python version 3.8, 3.9, 3.10, 3.11 diff --git a/pyproject.toml b/pyproject.toml index c6d345c..6de947c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,16 +6,16 @@ build-backend = "setuptools.build_meta" name = "vintage" description = "Python library for deprecating code" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.8" license = { text = "BSD 3-Clause License" } classifiers = [ - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [ "six",