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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,yaml,html}]
indent_size = 2
18 changes: 2 additions & 16 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Set version
env:
GITHUB_TAG: ${{github.ref}}
run: python scripts/ci_set_version_from_git.py
run: python -m pip install --upgrade pip twine build
- name: Build
run: python setup.py sdist bdist_wheel
- name: Assert version
env:
GITHUB_TAG: ${{github.ref}}
run: python scripts/ci_assert_version_from_git.py
run: python -m build
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ __pycache__
.vscode
*.egg-info
*.sqlite3
build
dist
django_toosimple_q/__version__.py
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ ARG TOOSIMPLEQ_PY_VERSION

FROM python:$TOOSIMPLEQ_PY_VERSION

RUN pip install --upgrade pip

WORKDIR /app

# Install app in editable mode
ADD ./requirements.txt /app/requirements.txt
ADD ./requirements-dev.txt /app/requirements-dev.txt
RUN touch /app/README.md
ADD ./django_toosimple_q/__init__.py /app/django_toosimple_q/__init__.py
ADD ./setup.py /app/setup.py
RUN pip install -r requirements-dev.txt
# Install empty project (source added/mounted later)
ENV SETUPTOOLS_SCM_PRETEND_VERSION 0.0.0
ADD pyproject.toml ./
RUN touch README.md
RUN mkdir django_toosimple_q
RUN pip install -e .[dev]

# Override django version
ARG TOOSIMPLEQ_DJ_VERSION
Expand Down
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
recursive-include django_toosimple_q *
recursive-exclude django_toosimple_q *.pyc
prune django_toosimple_q/tests
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,15 @@ Then connect on 127.0.0.1:8000/admin/
To run tests locally without Docker (by default, tests runs against an in-memory sqlite database):

```shell
pip install -r requirements-dev.txt
pip install -e .[dev]
python manage.py test
```

### Contribute

Code style is done with pre-commit :
```shell
pip install -r requirements-dev.txt
pip install -e .[dev]
pre-commit install
```

Expand Down
1 change: 0 additions & 1 deletion django_toosimple_q/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
__version__ = "dev" # DO NOT CHANGE THIS LINE - it will be replaced by CI workflow
default_app_config = "django_toosimple_q.apps.DjangoToosimpleQConfig"
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

version: "3"

x-default-django:
&default-django
x-default-django: &default-django
build:
context: .
args:
Expand Down Expand Up @@ -31,7 +30,7 @@ services:

worker:
<<: *default-django
command: worker --queue demo --reload never --verbosity 3
command: worker --queue demo --verbosity 3

postgres:
image: postgres
Expand Down
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools-scm[toml]>=7.1"]
build-backend = "setuptools.build_meta"

[project]
requires-python = ">=3.6"
name = "django-toosimple-q"
authors = [{ name = "Olivier Dalang", email = "[email protected]" }]
description = "A simplistic task queue and cron-like scheduler for Django"
keywords = ["django", "task", "queue", "worker", "scheduler", "cron", "job"]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
license = { text = "MIT License" }
dynamic = ["version", "readme"]
dependencies = [
"django>=3.2",
"django-picklefield>=3.0",
"croniter>=1.3",
]

[project.optional-dependencies]
dev = [
# tests
"freezegun==1.2.1",
"psycopg2==2.*",
# devenv
"pre-commit",
"mypy",
]

[project.urls]
homepage = "https://github.com/olivierdalang/django-toosimple-q"
repository = "https://github.com/olivierdalang/django-toosimple-q"
tracker = "https://github.com/olivierdalang/django-toosimple-q/issues"

[tool.setuptools_scm]
version_scheme = "post-release"
write_to = "django_toosimple_q/__version__.py"

[tool.setuptools.dynamic]
readme = { file = ["README.md"], content-type = "text/markdown" }
10 changes: 0 additions & 10 deletions requirements-dev.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/ci_assert_version_from_git.py

This file was deleted.

12 changes: 0 additions & 12 deletions scripts/ci_set_version_from_git.py

This file was deleted.

41 changes: 0 additions & 41 deletions setup.py

This file was deleted.