@@ -21,32 +21,31 @@ jobs:
2121
2222 strategy :
2323 matrix :
24- python-version : [' 3.10' ]
24+ python-version : [" 3.10" ]
2525
2626 steps :
2727 - name : Check out the repository
2828 uses : actions/checkout@v4
2929 with :
30- fetch-depth : 0 # Fetch all history to support dependency checks
30+ fetch-depth : 0 # Fetch all history to support dependency checks
3131 ref : ${{ github.head_ref || github.ref }}
3232
3333 - name : Set up Python
3434 uses : actions/setup-python@v5
3535 with :
3636 python-version : ${{ matrix.python-version }}
3737
38- - name : Install Poetry
38+ - name : Install uv
3939 run : |
40- curl -sSL https://install.python-poetry.org | python3 -
41- echo "$HOME/.local /bin" >> $GITHUB_PATH
40+ curl -LsSf https://astral.sh/uv/ install.sh | sh
41+ echo "$HOME/.cargo /bin" >> $GITHUB_PATH
4242
43- - name : Install Poetry Plugin for Export
43+ - name : Setup Python environment with uv
4444 run : |
45- poetry self add poetry-plugin-export
46-
47- - name : Install project with dev dependencies
48- run : |
49- poetry install --with dev
45+ uv venv
46+ source .venv/bin/activate
47+ uv pip install -e .
48+ uv pip install --group dev
5049
5150 - name : Check for dependency changes
5251 id : deps
6665
6766 echo "Changed files: $CHANGED_FILES"
6867
69- # Check if pyproject.toml or poetry.lock has changed
70- if echo "$CHANGED_FILES" | grep -qE '(^|/)pyproject\.toml$|(^|/)poetry\.lock$ '; then
68+ # Check if pyproject.toml has changed
69+ if echo "$CHANGED_FILES" | grep -qE '(^|/)pyproject\.toml$'; then
7170 echo "dependencies-changed=true" >> $GITHUB_ENV
7271 else
7372 echo "dependencies-changed=false" >> $GITHUB_ENV
7675 - name : Generate requirements.txt
7776 if : env.dependencies-changed == 'true'
7877 run : |
79- poetry export -f requirements.txt --output requirements.txt --without-hashes
78+ source .venv/bin/activate
79+ uv pip freeze > requirements.txt
8080
8181 - name : Commit and push updated requirements.txt
8282 if : |
@@ -92,58 +92,66 @@ jobs:
9292
9393 - name : Run Black (auto-reformat)
9494 run : |
95- poetry run black .
95+ source .venv/bin/activate
96+ black .
9697
9798 - name : Run isort (auto-reformat)
9899 run : |
99- poetry run isort .
100+ source .venv/bin/activate
101+ isort .
100102
101103 - name : Run pytest and generate coverage report
102104 run : |
103- poetry run pytest --cov-report=term-missing:skip-covered --cov=codes test/ --cov-report=xml:coverage.xml
105+ source .venv/bin/activate
106+ pytest --cov-report=term-missing:skip-covered --cov=codes test/ --cov-report=xml:coverage.xml
104107
105108 - name : Upload results to Codecov
106109 uses : codecov/codecov-action@v4
107110 with :
108- token : ${{ secrets.CODECOV_TOKEN }}
109- files : ./coverage.xml # Path to the coverage XML file, adjust if necessary
110- fail_ci_if_error : true # Optional, ensures the CI fails if Codecov upload fails
111+ token : ${{ secrets.CODECOV_TOKEN }}
112+ files : ./coverage.xml # Path to the coverage XML file, adjust if necessary
113+ fail_ci_if_error : true # Optional, ensures the CI fails if Codecov upload fails
111114
112115 docs :
113116 if : github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main')
114117 runs-on : ubuntu-latest
115118
116119 strategy :
117120 matrix :
118- python-version : [' 3.10' ]
121+ python-version : [" 3.10" ]
119122
120123 steps :
121124 - name : Check out the repository
122125 uses : actions/checkout@v4
123126 with :
124- fetch-depth : 0 # Fetch all history if necessary
127+ fetch-depth : 0 # Fetch all history if necessary
125128
126129 - name : Set up Python
127130 uses : actions/setup-python@v5
128131 with :
129132 python-version : ${{ matrix.python-version }}
130133
131- - name : Install Poetry
134+ - name : Install uv
132135 run : |
133- curl -sSL https://install.python-poetry.org | python3 -
134- echo "$HOME/.local /bin" >> $GITHUB_PATH
136+ curl -LsSf https://astral.sh/uv/ install.sh | sh
137+ echo "$HOME/.cargo /bin" >> $GITHUB_PATH
135138
136- - name : Install project with dev dependencies
139+ - name : Setup Python environment with uv
137140 run : |
138- poetry install --with dev
141+ uv venv
142+ source .venv/bin/activate
143+ uv pip install -e .
144+ uv pip install --group dev
139145
140146 - name : Generate API Documentation with Sphinx
141147 run : |
142- poetry run sphinx-apidoc -o docs/ codes
148+ source .venv/bin/activate
149+ sphinx-apidoc -o docs/ codes
143150
144151 - name : Build HTML with Sphinx
145152 run : |
146- poetry run sphinx-build -b html docs/ docs/_build
153+ source .venv/bin/activate
154+ sphinx-build -b html docs/ docs/_build
147155
148156 - name : Deploy Sphinx API docs to gh-pages
149157 uses : peaceiris/actions-gh-pages@v4
0 commit comments