Skip to content

chore: switch from Poetry to vanilla Pip #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 27, 2025
Merged
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
23 changes: 7 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,22 @@ jobs:
include: ${{ fromJson(needs.prepare.outputs.matrix) }}
name: "Python ${{ matrix.python-version }} + Django ${{ matrix.django-version }}"
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install poetry
- run: poetry install
- run: poetry build --format wheel
- name: Make sure tests use dist instead of source
run: |
rm -rf django_object_actions
pip install --force-reinstall dist/*.whl
- run: pip install -e '.[dev]'
- run: pip install "Django==${{ matrix.django-version }}.*"
- run: make test

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install poetry
- run: poetry install --with=dev
python-version: "3.13"
- run: pip install -e '.[dev]'
- run: make lint
16 changes: 11 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html#examples
name: Release

on:
Expand All @@ -16,26 +17,31 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
persist-credentials: false
- name: Setup | Force release branch to be at workflow sha
run: |
git reset --hard ${{ github.sha }}
- name: Python Semantic Release
id: release
# https://github.com/python-semantic-release/python-semantic-release/releases
# https://python-semantic-release.readthedocs.io/en/latest/github-action.html
uses: python-semantic-release/python-semantic-release@v9.8.8
uses: python-semantic-release/python-semantic-release@v9.21.0
with:
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}

- name: Publish package distributions to PyPI
- name: Publish | Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
# See https://github.com/actions/runner/issues/1173
if: steps.release.outputs.released == 'true'

- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/upload-to-gh-release@9.21.0
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ clean: ## Remove generated files
find . -type d -name "__pycache__" -exec rm -rf {} \; || true

install: ## Install development dependencies
poetry install
pip install -e '.[build,dev]'
pip install Django

lint: ## Check the project for lint errors
poetry run ruff check .
poetry run ruff format --diff .
ruff check .
ruff format --diff .

tdd: ## Run tests with a file watcher
PYTHONPATH=. nodemon --ext py -x sh -c "poetry run python -W ignore::RuntimeWarning $(MANAGE) test --failfast django_object_actions || true"
PYTHONPATH=. nodemon --ext py -x sh -c "python -W ignore::RuntimeWarning $(MANAGE) test --failfast django_object_actions || true"

test: ## Run test suite
PYTHONPATH=. poetry run python -W ignore::RuntimeWarning $(MANAGE) test django_object_actions
PYTHONPATH=. python -W ignore::RuntimeWarning $(MANAGE) test django_object_actions

coverage: ## Run and then display coverage report
poetry run coverage erase
PYTHONPATH=. poetry run coverage run $(MANAGE) test django_object_actions
poetry run coverage report --show-missing
coverage erase
PYTHONPATH=. coverage run $(MANAGE) test django_object_actions
coverage report --show-missing

resetdb: ## Delete and then recreate the dev sqlite database
python $(MANAGE) reset_db --router=default --noinput
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ make quickstart # runs 'make resetdb' and some extra steps
Various helpers are available as make commands. Type `make help` and
view the `Makefile` to see what other things you can do.

Some commands assume you are in the virtualenv. If you see
"ModuleNotFoundError"s, try running `poetry shell` first.

## Similar Packages

[Django Modal Actions](https://github.com/Mng-dev-ai/django-modal-actions) can
Expand Down
Loading