Skip to content

BE > Experiment w/ pyproject.toml/uv/pytest #8

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
18 changes: 12 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
uv pip install --system -e '.[dev]'
- name: Run Ruff
run: ruff check .
- name: Run Ruff Format
Expand All @@ -37,11 +40,14 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "Django==${{ matrix.django-version }}.*"
python -m pip install selenium webdriver-manager
uv pip install --system "Django==${{ matrix.django-version }}.*"
uv pip install --system -e '.[test]'
- name: Run Tests
run: |
python -m unittest discover django_modal_actions/tests
uv run pytest django_modal_actions/tests
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ These custom templates will include the modal action buttons while allowing you
To run the tests, execute:

```
python -m unittest discover django_modal_actions/tests
pip install -e '.[test]'
pytest django_modal_actions/tests
```

## Contributing
Expand All @@ -289,4 +290,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License.
This project is licensed under the MIT License.
65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

[project]
name = "django-modal-actions"
version = "0.1.4"
description = "A Django app for adding modal actions to the admin interface"
readme = "README.md"
authors = [
{name = "Michael Gendy", email = "nagymichel13@gmail.com"},
]
classifiers = [
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
]
requires-python = ">=3.7"
dependencies = [
"Django>=3.2",
]
license = {text = "MIT"}

[project.urls]
Homepage = "https://github.com/Mng-dev-ai/django-modal-actions"

[project.optional-dependencies]
dev = [
"ruff>=0.6.3",
"selenium>=4.24.0",
]
test = [
"pytest",
"pytest-cov",
"selenium",
"webdriver-manager",
]

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.ruff]
line-length = 120
target-version = "py37"
select = ["E", "F", "I", "D", "N", "S", "C90"]
# TODO: Why are these here? They are part of .gitignore so ruff should already exclude them?
exclude = [
".git",
"__pycache__",
"build",
"dist",
"*.egg-info",
"venv",
]

[tool.ruff.isort]
known-first-party = ["django_modal_actions"]
51 changes: 0 additions & 51 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

Loading