Switch from Poetry to UV #991
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python package | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.9', '3.10', '3.11'] | |
toxenv: [test] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install MongoDB | |
run: | | |
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb.gpg > /dev/null | |
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org | |
mongod --version | |
mongosh --version | |
- name: Install dependencies | |
run: uv sync --all-extras --dev | |
- name: Test with tox | |
run: uv run tox -e ${{ matrix.toxenv }} | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.10'] | |
toxenv: [black, isort, lint] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: uv sync --all-extras --dev | |
- name: Tests with tox | |
run: uv run tox -e ${{ matrix.toxenv }} | |
test-generate-docs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.10'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get install pandoc | |
uv sync --all-extras --dev | |
- name: Tests doc generation | |
run: uv run sphinx-build -b html docs/ docs/_build |