Skip to content

Commit

Permalink
Merge pull request #59 from eMBee/django-upgrade
Browse files Browse the repository at this point in the history
convert build setup to pyproject.toml
  • Loading branch information
mariobehling committed Mar 26, 2024
2 parents 2e7892b + acb5e78 commit 3d306c5
Show file tree
Hide file tree
Showing 11 changed files with 193 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install system packages
run: sudo apt update && sudo apt install gettext
- name: Install Dependencies
run: pip3 install -Ur src/requirements.txt
run: pip3 install -e ".[dev]"
- name: Compile messages
run: python manage.py compilemessages
working-directory: ./src
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Install system packages
run: sudo apt update && sudo apt install enchant hunspell hunspell-de-de aspell-en aspell-de
- name: Install Dependencies
run: pip3 install -Ur src/requirements/dev.txt
run: pip3 install -e ".[dev]"
- name: Spellcheck translations
run: potypo
working-directory: ./src
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: pip3 install -Ur src/requirements/dev.txt
run: pip3 install -e ".[dev]" psycopg2-binary
- name: Run isort
run: isort -c .
working-directory: ./src
Expand All @@ -49,7 +49,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt
run: pip3 install -e ".[dev]" psycopg2-binary
- name: Run flake8
run: flake8 .
working-directory: ./src
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Install system dependencies
run: sudo apt update && sudo apt install gettext mysql-client
- name: Install Python dependencies
run: pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt mysqlclient psycopg2-binary
run: pip3 install -e ".[dev]" psycopg2-binary
- name: Run checks
run: python manage.py check
working-directory: ./src
Expand Down
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tests:
- virtualenv env
- source env/bin/activate
- pip install -U pip wheel setuptools
- XDG_CACHE_HOME=/cache pip3 install -r src/requirements.txt --no-use-pep517 -Ur src/requirements/dev.txt
- XDG_CACHE_HOME=/cache pip3 install -e ".[dev]"
- cd src
- python manage.py check
- make all compress
Expand All @@ -21,7 +21,7 @@ pypi:
- virtualenv env
- source env/bin/activate
- pip install -U pip wheel setuptools check-manifest twine
- XDG_CACHE_HOME=/cache pip3 install -Ur src/requirements.txt -r src/requirements/dev.txt
- XDG_CACHE_HOME=/cache pip3 install -e ".[dev]"
- cd src
- python setup.py sdist
- pip install dist/pretix-*.tar.gz
Expand Down
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM python:3.8
working-directory: ./src

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -40,17 +41,14 @@ ENV LC_ALL=C.UTF-8 \
DJANGO_SETTINGS_MODULE=production_settings

# To copy only the requirements files needed to install from PIP
COPY src/requirements /pretix/src/requirements
COPY src/requirements.txt /pretix/src
COPY src/setup.py /pretix/src/setup.py
RUN pip3 install -U \
pip \
setuptools \
wheel && \
cd /pretix/src && \
pip3 install \
-r requirements.txt \
-r requirements/memcached.txt \
gunicorn django-extensions ipython && \
PRETIX_DOCKER_BUILD=TRUE pip3 install \
-e ".[memcached]" \
rm -rf ~/.cache/pip

COPY deployment/docker/pretix.bash /usr/local/bin/pretix
Expand Down
30 changes: 30 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
include LICENSE
include README.rst
global-include *.proto
recursive-include src/pretix/static *
recursive-include src/pretix/static.dist *
recursive-include src/pretix/locale *
recursive-include src/pretix/helpers/locale *
recursive-include src/pretix/base/templates *
recursive-include src/pretix/control/templates *
recursive-include src/pretix/presale/templates *
recursive-include src/pretix/plugins/banktransfer/templates *
recursive-include src/pretix/plugins/banktransfer/static *
recursive-include src/pretix/plugins/manualpayment/templates *
recursive-include src/pretix/plugins/manualpayment/static *
recursive-include src/pretix/plugins/paypal/templates *
recursive-include src/pretix/plugins/pretixdroid/templates *
recursive-include src/pretix/plugins/pretixdroid/static *
recursive-include src/pretix/plugins/sendmail/templates *
recursive-include src/pretix/plugins/statistics/templates *
recursive-include src/pretix/plugins/statistics/static *
recursive-include src/pretix/plugins/stripe/templates *
recursive-include src/pretix/plugins/stripe/static *
recursive-include src/pretix/plugins/ticketoutputpdf/templates *
recursive-include src/pretix/plugins/ticketoutputpdf/static *
recursive-include src/pretix/plugins/badges/templates *
recursive-include src/pretix/plugins/badges/static *
recursive-include src/pretix/plugins/returnurl/templates *
recursive-include src/pretix/plugins/returnurl/static *
recursive-include src/pretix/plugins/webcheckin/templates *
recursive-include src/pretix/plugins/webcheckin/static *
4 changes: 2 additions & 2 deletions doc/development/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ Working with the code
---------------------
The first thing you need are all the main application's dependencies::

cd src/
pip3 install -r requirements.txt -r requirements/dev.txt
pip3 install -e ".[dev]"

Next, you need to copy the SCSS files from the source folder to the STATIC_ROOT directory::

cd src/
python manage.py collectstatic --noinput

Then, create the local database::
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r ../src/requirements.txt
-e ../
sphinx==2.3.*
sphinx-rtd-theme
sphinxcontrib-httpdomain
Expand Down
145 changes: 145 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
[project]
name = "eventyay"
dynamic = ["version"]
description = "the open source event solution"
readme = "README.rst"
requires-python = ">=3.8"
license = {file = "LICENSE"}
keywords = ["tickets", "events", "web", "shop", "ecommerce"]
authors = [ {name = "eventyay", email = "info@eventyay.com"}, ]
maintainers = [ {name = "eventyay", email = "info@eventyay.com"}, ]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Environment :: Web Environment",
"License :: OSI Approved :: Apache License, Version 2.0",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Framework :: Django :: 3.2",
]
dependencies = [
'Django==3.2.*',
'djangorestframework==3.12.*',
'python-dateutil==2.8.*',
'isoweek',
'requests==2.25.0',
'pytz',
'django-bootstrap3==15.0.*',
'django-formset-js-improved==0.5.0.2',
'django-compressor==2.4.*',
'django-hierarkey==1.0.*,>=1.0.4',
'django-filter==2.4.*',
'django-scopes==1.2.*',
'django-localflavor==3.0.*',
'reportlab>=3.5.65',
'Pillow==8.*',
'PyPDF2==1.26.*',
'django-libsass==0.8',
'libsass==0.20.*',
'django-otp==0.7.*,>=0.7.5',
'webauthn==0.4.*',
'python-u2flib-server==4.*',
'django-formtools==2.3',
'celery==4.4.*',
'kombu==4.6.*',
'django-statici18n==1.9.*',
'inlinestyler==0.2.*',
'BeautifulSoup4==4.8.*',
'slimit',
'lxml',
'static3==0.7.*',
'dj-static',
'csscompressor',
'django-markup',
'markdown==3.3.*',
'bleach==3.3.*',
'sentry-sdk==0.14.*',
'babel',
'paypalrestsdk==1.13.*',
'pycparser==2.13', # https://github.com/eliben/pycparser/issues/147
'django-redis==4.11.*',
'redis==3.4.*',
'stripe==2.42.*',
'chardet<3.1.0,>=3.0.2',
'mt-940==3.2',
'django-i18nfield==1.9.*,>=1.9.1',
'psycopg2-binary',
'tqdm==4.*',
'vobject==0.9.*',
'pycountry',
'django-countries>=6.0',
'pyuca', # for better sorting of country names in django-countries
'defusedcsv>=1.1.0',
'vat_moss_forked==2020.3.20.0.11.0',
'jsonschema',
'django-hijack>=2.1.10,<2.2.0',
'openpyxl==3.0.*',
'django-oauth-toolkit==1.2.*',
'oauthlib==3.1.*',
'django-phonenumber-field==4.0.*',
'phonenumberslite==8.11.*',
'python-bidi==0.4.*', # Support for Arabic in reportlab
'arabic-reshaper==2.0.15', # Support for Arabic in reportlab
'packaging',
'tlds>=2020041600',
'text-unidecode==1.*',
'protobuf==3.15.*',
'cryptography>=3.4.2',
'sepaxml==2.4.*,>=2.4.1',
]

[project.optional-dependencies]
memcached = ["pylibmc"]
dev = [
'django-debug-toolbar==3.2',
'pycodestyle==2.5.*',
'pyflakes==2.1.*',
'flake8==3.7.*',
'pep8-naming',
'coveralls',
'coverage',
'pytest==6.*',
'pytest-django==4.*',
'pytest-xdist==1.31.*',
'isort',
'pytest-mock==2.0.*',
'pytest-rerunfailures==9.*',
'responses==0.23.0',
'potypo',
'freezegun',
'pytest-cache',
'pytest-cov',
'pytest-sugar',
]

[project.entry-points."distutils.commands"]
build = "setup:CustomBuild"
build_ext = "setup:CustomBuildExt"


[build-system]
requires = [
'setuptools',
'setuptools-rust',
'wheel',
'importlib_metadata',
]

[project.urls]
homepage = "https://eventyay.com"
repository = "https://github.com/fossasia/eventyay-tickets.git"
documentation = "https://eventyay.com"
changelog = "https://eventyay.com"

[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
version = {attr = "pretix.__version__"}

[tool.setuptools.packages.find]
where = ["src"]
include = ["pretix*"]
namespaces = false
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import setuptools

if __name__ == "__main__":
setuptools.setup()
30 changes: 0 additions & 30 deletions src/MANIFEST.in

This file was deleted.

0 comments on commit 3d306c5

Please sign in to comment.