Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 0 additions & 65 deletions .github/workflows/.github_reusable/poetry-setup.yml

This file was deleted.

26 changes: 5 additions & 21 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,18 @@ jobs:
with:
python-version: "3.11"

- name: Cache Poetry dependencies
uses: actions/cache@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-quality-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-quality-

- name: Setup Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: "1.8.4"

- name: Cache virtual environment
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-venv-
enable-cache: true

- name: Install dependencies
run: poetry install --only code-quality
run: uv sync --extra code-quality

- name: Run pre-commit with debug
run: |
echo "Running pre-commit hooks with verbose output..."
poetry run pre-commit run --all-files --verbose
uv run pre-commit run --all-files --verbose
if [ $? -ne 0 ]; then
echo "Pre-commit failed. Showing git status:"
git status
Expand Down
38 changes: 9 additions & 29 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
with:
python-version: "3.9"

- name: Install Poetry
uses: abatilo/actions-poetry@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
poetry-version: "1.8.4"
enable-cache: true

- name: Get release tag
id: get_tag
Expand All @@ -37,58 +37,38 @@ jobs:
VERSION=${TAG#v} # Remove "v" prefix if present
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Verify package version matches tag
run: |
PACKAGE_VERSION=$(poetry version -s)
if [ "$PACKAGE_VERSION" != "${{ env.VERSION }}" ]; then
echo "Package version ($PACKAGE_VERSION) does not match tag version (${{ env.VERSION }})"
exit 1
fi

- name: Update package version from tag
run: |
echo "Updating version to ${{ env.VERSION }}"
poetry version ${{ env.VERSION }}
# Update version in pyproject.toml
sed -i "s/version = \".*\"/version = \"${{ env.VERSION }}\"/" pyproject.toml

- name: Compile translations
run: |
echo "Compiling translation files..."
poetry run pybabel compile --domain django --directory djoser/locale -f
uv run pybabel compile --domain django --directory djoser/locale -f

- name: Build package
run: |
echo "Building package..."
poetry build
uv build
echo "Package contents:"
ls -l dist/

# Test PyPI deployment for pre-releases
- name: Configure Test PyPI
if: github.event.release.prerelease
run: |
echo "Configuring Test PyPI..."
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}

- name: Publish to Test PyPI
if: github.event.release.prerelease
run: |
echo "Publishing to Test PyPI..."
poetry publish --no-interaction -r testpypi
uv publish --index-url https://test.pypi.org/legacy/ --token ${{ secrets.TEST_PYPI_TOKEN }}
echo "Package published to Test PyPI successfully"

# Production PyPI deployment
- name: Configure PyPI
if: "!github.event.release.prerelease"
run: |
echo "Configuring PyPI..."
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}

- name: Publish to PyPI
if: "!github.event.release.prerelease"
run: |
echo "Publishing to PyPI..."
poetry publish --no-interaction
uv publish --token ${{ secrets.PYPI_TOKEN }}
echo "Package published to PyPI successfully"

- name: Verify publish
Expand Down
Loading
Loading