Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 080ee8c

Browse files
authoredMar 27, 2025··
chore: switch from Poetry to vanilla Pip (#180)
Updating the project to match my current style and to reduce dependencies.
1 parent 988ce82 commit 080ee8c

File tree

7 files changed

+53
-300
lines changed

7 files changed

+53
-300
lines changed
 

‎.github/workflows/ci.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,22 @@ jobs:
3131
include: ${{ fromJson(needs.prepare.outputs.matrix) }}
3232
name: "Python ${{ matrix.python-version }} + Django ${{ matrix.django-version }}"
3333
runs-on: ubuntu-latest
34-
env:
35-
POETRY_VIRTUALENVS_CREATE: false
3634
steps:
37-
- uses: actions/checkout@v3
38-
- uses: actions/setup-python@v4
35+
- uses: actions/checkout@v4
36+
- uses: actions/setup-python@v5
3937
with:
4038
python-version: ${{ matrix.python-version }}
41-
- run: pip install poetry
42-
- run: poetry install
43-
- run: poetry build --format wheel
44-
- name: Make sure tests use dist instead of source
45-
run: |
46-
rm -rf django_object_actions
47-
pip install --force-reinstall dist/*.whl
39+
- run: pip install -e '.[dev]'
4840
- run: pip install "Django==${{ matrix.django-version }}.*"
4941
- run: make test
5042

5143
lint:
5244
runs-on: ubuntu-latest
5345
steps:
54-
- uses: actions/checkout@v3
46+
- uses: actions/checkout@v4
5547
- name: Set up Python
56-
uses: actions/setup-python@v4
48+
uses: actions/setup-python@v5
5749
with:
58-
python-version: "3.12"
59-
- run: pip install poetry
60-
- run: poetry install --with=dev
50+
python-version: "3.13"
51+
- run: pip install -e '.[dev]'
6152
- run: make lint

‎.github/workflows/release.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html#examples
12
name: Release
23

34
on:
@@ -16,26 +17,31 @@ jobs:
1617
contents: write
1718

1819
steps:
19-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2021
with:
2122
fetch-depth: 0
23+
ref: ${{ github.ref_name }}
2224
persist-credentials: false
25+
- name: Setup | Force release branch to be at workflow sha
26+
run: |
27+
git reset --hard ${{ github.sha }}
2328
- name: Python Semantic Release
2429
id: release
2530
# https://github.com/python-semantic-release/python-semantic-release/releases
2631
# https://python-semantic-release.readthedocs.io/en/latest/github-action.html
27-
uses: python-semantic-release/python-semantic-release@v9.8.8
32+
uses: python-semantic-release/python-semantic-release@v9.21.0
2833
with:
2934
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
3035

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

37-
- name: Publish package distributions to GitHub Releases
38-
uses: python-semantic-release/upload-to-gh-release@main
42+
- name: Publish | Upload to GitHub Release Assets
43+
uses: python-semantic-release/upload-to-gh-release@9.21.0
3944
if: steps.release.outputs.released == 'true'
4045
with:
4146
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
47+
tag: ${{ steps.release.outputs.tag }}

‎Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ clean: ## Remove generated files
2424
find . -type d -name "__pycache__" -exec rm -rf {} \; || true
2525

2626
install: ## Install development dependencies
27-
poetry install
27+
pip install -e '.[build,dev]'
2828
pip install Django
2929

3030
lint: ## Check the project for lint errors
31-
poetry run ruff check .
32-
poetry run ruff format --diff .
31+
ruff check .
32+
ruff format --diff .
3333

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

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

4040
coverage: ## Run and then display coverage report
41-
poetry run coverage erase
42-
PYTHONPATH=. poetry run coverage run $(MANAGE) test django_object_actions
43-
poetry run coverage report --show-missing
41+
coverage erase
42+
PYTHONPATH=. coverage run $(MANAGE) test django_object_actions
43+
coverage report --show-missing
4444

4545
resetdb: ## Delete and then recreate the dev sqlite database
4646
python $(MANAGE) reset_db --router=default --noinput

‎README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,6 @@ make quickstart # runs 'make resetdb' and some extra steps
258258
Various helpers are available as make commands. Type `make help` and
259259
view the `Makefile` to see what other things you can do.
260260

261-
Some commands assume you are in the virtualenv. If you see
262-
"ModuleNotFoundError"s, try running `poetry shell` first.
263-
264261
## Similar Packages
265262

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

‎poetry.lock

Lines changed: 0 additions & 243 deletions
This file was deleted.

‎pyproject.toml

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
[build-system]
2-
requires = ["poetry_core>=1.0.0"]
3-
build-backend = "poetry.core.masonry.api"
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"
44

5-
[tool.poetry]
5+
[project]
66
name = "django-object-actions"
77
version = "4.3.0"
88
description = "A Django app for adding object tools for models in the admin"
9-
authors = ["crccheck <c@crccheck.com>"]
10-
license = "Apache-2.0"
9+
authors = [{ name = "crccheck", email = "c@crccheck.com" }]
10+
license = { text = "Apache-2.0" }
1111
readme = "README.md"
12-
13-
repository = "https://github.com/crccheck/django-object-actions"
14-
1512
keywords = ["django", "admin"]
13+
requires-python = ">=3.9"
1614
classifiers = [
1715
"Development Status :: 5 - Production/Stable",
1816
"Framework :: Django",
@@ -27,20 +25,31 @@ classifiers = [
2725
"Programming Language :: Python :: 3.13",
2826
]
2927

30-
[tool.poetry.dependencies]
31-
python = "^3.9"
28+
[project.urls]
29+
"Homepage" = "https://github.com/crccheck/django-object-actions"
3230

33-
[tool.poetry.group.dev.dependencies]
34-
coverage = "7.*"
35-
django-extensions = "3.*"
36-
factory-boy = "3.*"
37-
dj-database-url = "2.*"
38-
ruff = "*"
31+
[project.optional-dependencies]
32+
dev = [
33+
"coverage==7.*",
34+
"django-extensions==3.*",
35+
"factory-boy==3.*",
36+
"dj-database-url==2.*",
37+
"ruff",
38+
]
39+
build = ["build", "twine"]
40+
41+
[tool.setuptools]
42+
packages = [
43+
"django_object_actions",
44+
"django_object_actions.templates.django_object_actions",
45+
]
46+
[tool.setuptools.package-data]
47+
"django_object_actions.templates.django_object_actions" = ["*.html"]
3948

4049
[tool.semantic_release]
41-
version_toml = ["pyproject.toml:tool.poetry.version"]
50+
version_toml = ["pyproject.toml:project.version"]
4251
version_variables = ["django_object_actions/__init__.py:__version__"]
43-
build_command = "pip install poetry && poetry build"
52+
build_command = "pip install -e '.[build]' && python -m build"
4453

4554
[tool.coverage.run]
4655
source = ["django_object_actions"]
@@ -56,7 +65,6 @@ exclude_lines = [
5665
]
5766

5867
[tool.ruff]
59-
target-version = "py37"
6068

6169
[tool.ruff.lint]
6270
extend-select = ["UP"]

‎setup.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.