diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 154d0ef..d71ad69 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,8 +14,8 @@ jobs: - "==4.1.*" - "==4.2.*" include: - - django: "==3.2.*" - python: '3.10' + - python: '3.10' + django: "==3.2.*" # Python 3.11 & Django 3.2 raises deprecation warning about deprecated 'cgi' for Python 3.13 steps: - uses: actions/checkout@v1 @@ -33,6 +33,13 @@ jobs: - name: Build test run: make test + - name: Build package + run: make build_pkg + + - uses: actions/upload-artifact@v3 + with: + name: distribution + path: dist docs: runs-on: ubuntu-latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ba61038..e7ae79f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,15 +11,13 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.7 + - name: Set up Python 3.10 uses: actions/setup-python@v1 with: - python-version: "3.7" + python-version: "3.10" - name: Build distribution - run: | - pip install setuptools_scm wheel - python3 setup.py sdist bdist_wheel + run: make build_pkg - name: Publish distribution 📦 to PyPI if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') diff --git a/HISTORY.rst b/HISTORY.rst index 1d37928..bedc549 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,11 @@ History ------- +0.18.1 (2023-09-24) +******************* + +* Integrate pyproject.toml + 0.18.0 (2023-09-04) ******************* diff --git a/Makefile b/Makefile index 5a4df42..bf450e1 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,10 @@ assets: build: docker-compose build web +build_pkg: + python -m pip install --upgrade build + python -m build + test: assets docker-compose run -v $$PWD/assets:/assets -e PYTHONWARNINGS=error -e CACHE_DIR=/assets/ web python manage.py test --keepdb --verbosity=2 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c3c3d61 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[project] +dynamic = ["version"] +name = "django-teryt-tree" +readme = "README.rst" +authors = [ + { name="Adam Dobrawy", email="adam.dobrawy@siecobywatelska.pl" }, +] +description = 'Django-teryt-tree is a Django app that implements TERYT database as tree by django-mptt.' +dependencies = ['django-mptt', 'django-model-utils', 'django-autoslug', 'tqdm'] +requires-python = ">=3.10" +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Web Environment', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Natural Language :: Polish', + 'Framework :: Django', + 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.1', + 'Framework :: Django :: 4.2', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11' +] +keywords = ['django-teryt-tree'] +license = {file = "LICENSE"} + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +where = ["."] +include = ["teryt_tree*", "teryt_tree.locale.pl.LC_MESSAGES"] + +[tool.setuptools_scm] +write_to = "teryt_tree/_version.py" + +[build-system] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] diff --git a/setup.py b/setup.py index 21b0f91..3ab4913 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,6 @@ setup_requires=["setuptools_scm", "wheel"], install_requires=["django-mptt", "django-model-utils", "django-autoslug", "tqdm"], download_url="https://github.com/ad-m/django-teryt-tree/", - license="BSD", zip_safe=False, keywords="django-teryt-tree", classifiers=[ diff --git a/teryt_tree/.gitignore b/teryt_tree/.gitignore new file mode 100644 index 0000000..f528fc4 --- /dev/null +++ b/teryt_tree/.gitignore @@ -0,0 +1 @@ +_version.py \ No newline at end of file diff --git a/teryt_tree/__init__.py b/teryt_tree/__init__.py index a037cbd..e69de29 100644 --- a/teryt_tree/__init__.py +++ b/teryt_tree/__init__.py @@ -1,7 +0,0 @@ -from pkg_resources import get_distribution, DistributionNotFound - -try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: - # package is not installed - pass diff --git a/teryt_tree/static/css/teryt_tree.css b/teryt_tree/static/css/teryt_tree.css deleted file mode 100644 index e69de29..0000000 diff --git a/teryt_tree/static/img/.gitignore b/teryt_tree/static/img/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/teryt_tree/static/js/teryt_tree.js b/teryt_tree/static/js/teryt_tree.js deleted file mode 100644 index e69de29..0000000