Skip to content

Commit 70ff032

Browse files
peterfarrellFerhan Syed
andauthored
33 switch to uv for package dependencies (#38)
* closes #33 * fix: generate lock file with django version to resolve pipeline error * fix: change min python version to 3.9 * fix: rerun uv sync to fix uvlock file * fix: djange and python versioning. * fix: remove an = sign * fix: remove requires_python for more explicit versioning * More changes * fix toml file * more testing * Improve documentation * fix black formatting * close #35 * Update CHANGELOG.md * Updated CHANGELOG * Drop official support for Python 3.9 --------- Co-authored-by: Ferhan Syed <ferhan_syed@saa.senate.gov>
1 parent 9db2a20 commit 70ff032

8 files changed

Lines changed: 1025 additions & 97 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ jobs:
99
matrix:
1010
include:
1111
# Django 3.2
12-
- django-version: "3.2.25"
13-
python-version: "3.9"
1412
- django-version: "3.2.25"
1513
python-version: "3.10"
1614
# Django 4.2
17-
- django-version: "4.2.23"
18-
python-version: "3.9"
1915
- django-version: "4.2.23"
2016
python-version: "3.10"
2117
- django-version: "4.2.23"
@@ -33,17 +29,16 @@ jobs:
3329
python-version: "3.13"
3430
steps:
3531
- uses: actions/checkout@v4
36-
- name: Set up Python ${{ matrix.python-version }}
37-
uses: actions/setup-python@v4
32+
- name: Set up uv
33+
uses: astral-sh/setup-uv@v6
3834
with:
3935
python-version: ${{ matrix.python-version }}
36+
- name: Use specific django version
37+
run: uv add -U django~=${{ matrix.django-version }}
4038
- name: Install dependencies
41-
run: |
42-
pip install --upgrade -r requirements.txt
43-
pip install django~=${{ matrix.django-version }}
44-
pip install .
39+
run: uv sync --all-extras
4540
- name: Run tests
4641
run: |
47-
coverage run --source herald runtests.py -v 2
42+
uv run coverage run --source herald runtests.py -v 2
4843
- name: Report coverage to Codecov
4944
uses: codecov/codecov-action@v3

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
## Unreleased
44

55
- #35 via MR #36 - Add security policy via `SECURITY.md`
6+
- #33 via MR #38 - Switch to `uv` for package dependencies
7+
- Chore/Docs: Drop official support for Python 3.9 (EOL October 2025)
68

79

810
## 0.4.1 (08-21-2025)
9-
- #31 - Fix AppRegistryNotReady error on importing from herald.base
11+
- #31 - Fix AppRegistryNotReady error on importing from `herald.base`
1012

1113

1214
## 0.4.0 (06-10-2025)

CONTRIBUTING.md

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,64 @@
1-
# Contrinbuting
1+
# Contributing
2+
3+
## Development Environment Setup
4+
5+
1. **Fork and clone the repository.**
6+
7+
2. **Install `uv`**
8+
This project uses `uv` for fast environment and package management.
9+
10+
If you don't have `uv` installed:
11+
```bash
12+
pip install uv
13+
```
14+
15+
3. **Create a virtual environment and install dependencies.**
16+
This project uses `uv` for fast environment and package management.
17+
18+
First, create and activate a virtual environment:
19+
```bash
20+
uv venv
21+
source .venv/bin/activate
22+
```
23+
24+
Next, install all required dependencies and extras for development in editable mode:
25+
```bash
26+
uv sync --all-extras
27+
```
28+
29+
4. **Optional: Change Python version**
30+
31+
You can change the Python version:
32+
```bash
33+
uv python install 3.10
34+
```
35+
36+
List all Python versions:
37+
```bash
38+
uv python list
39+
```
40+
41+
## Supported versions for Twilio and html2text
42+
43+
* Twilio (SemVer) is supported till latest major version - 1 (e.g 9.x.x - 1 = version 8.x.x and higher)
44+
* html2text (CalVer) is supported till current calendar year - 1 (e.g. 2025 - 1 = version 2024.x.x and newer)
245

346
## Running Tests
447

548
This will run with a SQLite3 in-memory database:
649

750
```bash
8-
python runtests.py -v 2
51+
uv run runtests.py -v 2
952
```
1053

1154
## Running Server to See Views
1255

1356
You will need to run migrations:
14-
1557
```bash
16-
python manage.py migrate
58+
uv run manage.py migrate
1759
```
1860

1961
Run server:
20-
2162
```bash
22-
python manage.py runserver 0.0.0.0:8000
63+
uv run manage.py runserver 0.0.0.0:8000
2364
```

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ For python, Heralder supports all versions of python that the above versions of
3434

3535
As of Heralder v0.4.0, we support:
3636

37-
| Django | Python `3.9` | Python `3.10` | Python `3.11` | Python `3.12` | Python `3.13` |
37+
| Django | Python `3.10` | Python `3.11` | Python `3.12` | Python `3.13` |
3838
| --- | --- | --- | --- | --- | --- |
39-
| `3.2.x` | **Y** | **Y** | - | - | - |
40-
| `4.2.x` | **Y** | **Y** | **Y** | **Y** | - |
41-
| `5.2.x` | - | **Y** | **Y** | **Y** | **Y** |
39+
| `3.2.x` | **Y** | - | - | - |
40+
| `4.2.x` | **Y** | **Y** | **Y** | - |
41+
| `5.2.x` | **Y** | **Y** | **Y** | **Y** |
4242

4343
### Installation
4444

pyproject.toml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[project]
2+
name = "django-heralder"
3+
version = "0.0.0"
4+
requires-python = ">=3.10,<3.14"
5+
readme = "README.md"
6+
license = "MIT"
7+
description = "Django library for separating the message content from transmission method."
8+
authors = [
9+
{ name = "PJ Farrell", email = "pj@mariska.dev" }
10+
]
11+
12+
dependencies = [
13+
"django>=3.2,<=5.2",
14+
"jsonpickle>=4.1.1",
15+
]
16+
17+
keywords = [
18+
"django",
19+
"notifications",
20+
"messaging",
21+
]
22+
23+
classifiers = [
24+
"Development Status :: 5 - Production/Stable",
25+
"Framework :: Django",
26+
"Intended Audience :: Developers",
27+
"Framework :: Django",
28+
"Framework :: Django :: 3.2",
29+
"Framework :: Django :: 4.2",
30+
"Framework :: Django :: 5.2",
31+
"Programming Language :: Python",
32+
"Programming Language :: Python :: 3",
33+
"Programming Language :: Python :: 3.10",
34+
"Programming Language :: Python :: 3.11",
35+
"Programming Language :: Python :: 3.12",
36+
"Programming Language :: Python :: 3.13",
37+
"Programming Language :: Python :: 3 :: Only",
38+
"License :: OSI Approved :: MIT License",
39+
]
40+
41+
[project.optional-dependencies]
42+
twilio = [
43+
"twilio>=8.11.1",
44+
]
45+
html2text = [
46+
"html2text>=2025.2.26",
47+
]
48+
49+
[dependency-groups]
50+
dev = [
51+
"coveralls>=4.0.1",
52+
"mock>=5.2.0",
53+
"pytz>=2025.2",
54+
]

requirements.txt

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

setup.py

Lines changed: 11 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,12 @@
1-
import os
2-
3-
from setuptools import find_packages, setup
4-
5-
VERSION = __import__("herald").__version__
6-
7-
8-
def read_file(filename):
9-
"""Read a file into a string"""
10-
path = os.path.abspath(os.path.dirname(__file__))
11-
filepath = os.path.join(path, filename)
12-
try:
13-
return open(filepath).read()
14-
except IOError:
15-
return ""
16-
17-
18-
install_requires = [
19-
"django>=3.2",
20-
"jsonpickle",
21-
]
22-
dev_requires = [
23-
"pytz",
24-
]
25-
twilio_requires = [
26-
"twilio",
27-
]
28-
html2text_requires = [
29-
"html2text",
30-
]
31-
32-
setup(
33-
name="django-heralder",
34-
version=VERSION,
35-
author="PJ Farrell",
36-
author_email="pjf@maepub.com",
37-
install_requires=install_requires,
38-
extras_require={
39-
"dev": install_requires + dev_requires,
40-
"twilio": twilio_requires,
41-
"html2text": html2text_requires,
42-
},
43-
packages=find_packages(exclude=["tests"]),
44-
include_package_data=True, # declarations in MANIFEST.in
45-
license="MIT",
46-
url="https://github.com/peterfarrell/django-heralder/",
47-
download_url="https://github.com/peterfarrell/django-heralder/tarball/" + VERSION,
48-
description="Django library for separating the message content from transmission method",
49-
long_description=read_file("README.md"),
50-
long_description_content_type="text/markdown",
51-
keywords=["django", "notifications", "messaging"],
52-
classifiers=[
53-
"Framework :: Django",
54-
"Intended Audience :: Developers",
55-
"Framework :: Django",
56-
"Framework :: Django :: 3.2",
57-
"Framework :: Django :: 4.2",
58-
"Framework :: Django :: 5.2",
59-
"Programming Language :: Python",
60-
"Programming Language :: Python :: 3",
61-
"Programming Language :: Python :: 3.7",
62-
"Programming Language :: Python :: 3.8",
63-
"Programming Language :: Python :: 3.9",
64-
"Programming Language :: Python :: 3.10",
65-
"Programming Language :: Python :: 3.11",
66-
"Programming Language :: Python :: 3.12",
67-
"Programming Language :: Python :: 3 :: Only",
68-
"License :: OSI Approved :: MIT License",
69-
],
1+
import sys
2+
3+
sys.stderr.write(
4+
"""\
5+
===============================
6+
Unsupported installation method
7+
===============================
8+
This project no longer supports installation with `python setup.py install .`.
9+
Please use `python -m pip install .` instead.
10+
"""
7011
)
12+
sys.exit(1)

0 commit comments

Comments
 (0)