diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 3a9dffec..b94fe9af 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -2,56 +2,58 @@ name: Codecov on: [push, pull_request] jobs: run: - name: test ${{ matrix.os }} / ${{ matrix.python }} + name: test ${{ matrix.os }} / ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] - python: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] env: OS: ${{ matrix.os }} - PYTHON: ${{ matrix.python }} + PYTHON: ${{ matrix.python-version }} steps: - uses: actions/checkout@master - - uses: pdm-project/setup-pdm@v4 + + - uses: astral-sh/setup-uv@v5 with: - python-version: ${{ matrix.python }} - allow-python-prereleases: true - cache: true - - name: install deps + python-version: ${{ matrix.python-version }} + + - name: Install core deps run: | - pdm use -f $PYTHON - pdm install -d - - name: Generate coverage report (default) + uv sync + - run: 'uv run python -c "import pydantic.version; print(pydantic.version.version_info())"' + - name: Generate coverage report (core) run: | - pdm run pytest --cov=aiopenapi3/ --cov-report=xml:./coverage/reports/coverage-default.xml tests/ - pdm run pytest --cov=tests/ --cov-report=xml:./coverage/reports/coverage-default-tests.xml tests/ - - name: install optional deps + uv run pytest --cov=. --cov-report=xml:./coverage/coverage-core.xml tests/ + + - name: Install extra deps run: | - pdm install -G auth,socks - - name: Generate coverage report (options) + uv sync --all-extras + + - name: Generate coverage report (extra) run: | - pdm run pytest --cov=aiopenapi3/ --cov-report=xml:./coverage/reports/coverage-optional.xml tests/ - pdm run pytest --cov=tests/ --cov-report=xml:./coverage/reports/coverage-optional-tests.xml tests/ + uv run pytest --cov=. --cov-report=xml:./coverage/coverage-extra.xml tests/ + - name: Upload coverage to Codecov (core) uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - files: coverage-default.xml,coverage-optional.xml + directory: coverage + files: coverage-core.xml env_vars: OS,PYTHON fail_ci_if_error: false flags: core name: codecov-aiopenapi3 verbose: true - - name: Upload coverage to Codecov (tests) + + - name: Upload coverage to Codecov (extra) uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - files: coverage-default-tests.xml,coverage-optional-tests.xml + directory: coverage + files: coverage-extra.xml env_vars: OS,PYTHON fail_ci_if_error: false - flags: tests - name: codecov-aiopenapi3-tests + flags: extras + name: codecov-aiopenapi3-extras verbose: true diff --git a/.github/workflows/pdm.yml b/.github/workflows/pdm.yml deleted file mode 100644 index 2c42231d..00000000 --- a/.github/workflows/pdm.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: PDM update dependencies - -on: - schedule: - - cron: "9 4 * * 5" - workflow_dispatch: {} - -jobs: - pdm-update-dependencies: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: PDM update dependencies - uses: pdm-project/update-deps-action@main - with: - commit-message: "chore: Update pdm.lock" - # The PR title - pr-title: "PDM - update dependencies" - # The update strategy, can be 'reuse', 'eager' or 'all' - update-strategy: eager - # Whether to install PDM plugins before update - install-plugins: "true" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index caa59877..f8a2928e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,9 +14,9 @@ jobs: id-token: write steps: - uses: actions/checkout@v3 - - uses: pdm-project/setup-pdm@v4 + - uses: astral-sh/setup-uv@v5 - name: Publish package distributions to test.PyPI - run: pdm publish --repository testpypi + run: uv publish --index testpypi pypi-publish: name: upload release to PyPI @@ -26,6 +26,6 @@ jobs: id-token: write steps: - uses: actions/checkout@v3 - - uses: pdm-project/setup-pdm@v4 + - uses: astral-sh/setup-uv@v5 - name: Publish package distributions to PyPI - run: pdm publish + run: uv publish diff --git a/pyproject.toml b/pyproject.toml index 0cddfa7e..d1ba8715 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,8 +102,8 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" addopts = "--ignore-glob 'tests/my_*.py'" -[tool.pdm.dev-dependencies] -tests = [ +[tool.uv] +dev-dependencies = [ "pytest", "pytest-asyncio>=0.24.0", "pytest-httpx", @@ -111,8 +111,7 @@ tests = [ "pytest-mock", "fastapi", "fastapi-versioning", - "uvloop == 0.21.0b1; python_version >= '3.13'", - "uvloop; python_version < '3.13'", + "uvloop", "flask", "flask_wtf", "wtforms", @@ -122,19 +121,18 @@ tests = [ "bootstrap-flask", "ijson", "python-multipart>=0.0.6", - "pydantic-extra-types @ git+https://github.com/pydantic/pydantic-extra-types.git@3668b3af8ab378c56342c613672aa9415dab865b" + "pydantic-extra-types>=2.10.1" ] -[tool.pdm] -plugins = [ - "pdm-autoexport" -] - -[[tool.pdm.autoexport]] -filename = "requirements.txt" -groups = ["default"] -without-hashes = "true" +[[tool.uv.index]] +name = "pypi" +url = "https://pypi.org/simple/" +publish-url = "https://pypi.org/legacy/" +[[tool.uv.index]] +name = "testpypi" +url = "https://test.pypi.org/simple/" +publish-url = "https://test.pypi.org/legacy/" [tool.mypy] allow_redefinition = true