Skip to content

Commit

Permalink
Merge pull request #76 from eMBee/django-upgrade
Browse files Browse the repository at this point in the history
Django upgrade rebased on current development
  • Loading branch information
marcoag authored May 13, 2024
2 parents f6f564c + cf8d7c7 commit 3f88eb0
Show file tree
Hide file tree
Showing 488 changed files with 3,147 additions and 13,591 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates


version: 2

updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: increase
- package-ecosystem: "npm"
directory: "/src/pretix/static/npm_dir"
schedule:
interval: "daily"
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
12 changes: 4 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@ jobs:
name: Tests
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.8]
database: [sqlite, postgres, mysql]
exclude:
- database: mysql
python-version: 3.7
python-version: 3.8
- database: sqlite
python-version: 3.7
- database: mysql
python-version: 3.6
- database: sqlite
python-version: 3.6
python-version: 3.8
steps:
- uses: actions/checkout@v2
- uses: getong/[email protected]
Expand Down Expand Up @@ -57,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
27 changes: 10 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM python:3.8-bookworm
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
default-libmysqlclient-dev \
gettext \
git \
libffi-dev \
Expand Down Expand Up @@ -37,30 +36,24 @@ RUN apt-get update && \
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
RUN pip3 install -U \
pip \
setuptools \
wheel && \
cd /pretix/src && \
pip3 install \
-r requirements.txt \
-r requirements/memcached.txt \
-r requirements/mysql.txt \
gunicorn django-extensions ipython && \
rm -rf ~/.cache/pip

COPY deployment/docker/pretix.bash /usr/local/bin/pretix
COPY deployment/docker/supervisord /etc/supervisord
COPY deployment/docker/supervisord.all.conf /etc/supervisord.all.conf
COPY deployment/docker/supervisord.web.conf /etc/supervisord.web.conf
COPY deployment/docker/nginx.conf /etc/nginx/nginx.conf
COPY deployment/docker/production_settings.py /pretix/src/production_settings.py
COPY pyproject.toml /pretix/pyproject.toml
COPY src /pretix/src

RUN cd /pretix/src && pip3 install .
RUN pip3 install -U \
pip \
setuptools \
wheel && \
cd /pretix && \
PRETIX_DOCKER_BUILD=TRUE pip3 install \
-e ".[memcached]" \
gunicorn django-extensions ipython && \
rm -rf ~/.cache/pip

RUN chmod +x /usr/local/bin/pretix && \
rm /etc/nginx/sites-enabled/default && \
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 *
11 changes: 2 additions & 9 deletions doc/admin/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,30 +135,23 @@ Database settings
Example::

[database]
backend=mysql
backend=postgresql
name=pretix
user=pretix
password=abcd
host=localhost
port=3306

``backend``
One of ``mysql``, ``sqlite3``, ``oracle`` and ``postgresql``.
One of ``sqlite3``, ``oracle`` and ``postgresql``.
Default: ``sqlite3``.

If you use MySQL, be sure to create your database using
``CREATE DATABASE <dbname> CHARACTER SET utf8;``. Otherwise, Unicode
support will not properly work.

``name``
The database's name. Default: ``db.sqlite3``.

``user``, ``password``, ``host``, ``port``
Connection details for the database connection. Empty by default.

``galera``
Indicates if the database backend is a MySQL/MariaDB Galera cluster and
turns on some optimizations/special case handlers. Default: ``False``

.. _`config-replica`:

Expand Down
8 changes: 5 additions & 3 deletions doc/development/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ Your should install the following on your system:
* ``libssl`` (Debian package: ``libssl-dev``)
* ``libxml2`` (Debian package ``libxml2-dev``)
* ``libxslt`` (Debian package ``libxslt1-dev``)
* ``libenchant1c2a`` (Debian package ``libenchant1c2a``)
* ``libenchant1c2a`` (Debian package ``libenchant1c2a`` or ``libenchant2-2``)
* ``msgfmt`` (Debian package ``gettext``)
* ``freetype`` (Debian package ``libfreetype-dev``)
* ``git``
* for pillow: ``libjpeg`` (Debian Package ``libjpeg-dev``)

Your local python environment
-----------------------------
Expand All @@ -53,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 = "[email protected]"}, ]
maintainers = [ {name = "eventyay", email = "[email protected]"}, ]
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==4.2.*',
'djangorestframework==3.14.*',
'python-dateutil==2.8.*',
'isoweek',
'requests==2.31.*',
'pytz',
'django-bootstrap3==23.1.*',
'django-formset-js-improved==0.5.0.3',
'django-compressor==4.3.*',
'django-hierarkey==1.1.*',
'django-filter==23.2',
'django-scopes==2.0.*',
'django-localflavor==4.0',
'reportlab==4.0.*',
'Pillow==9.5.*',
'PyPDF2==2.12.*',
'django-libsass==0.9',
'libsass==0.22.*',
'django-otp==1.2.*',
'webauthn==0.4.*',
'python-u2flib-server==4.*',
'django-formtools==2.4.1',
'celery==5.3.*',
'kombu==5.3.*',
'django-statici18n==2.3.*',
'css-inline==0.8.*',
'BeautifulSoup4==4.12.*',
'slimit',
'lxml',
'static3==0.7.*',
'dj-static',
'csscompressor',
'django-markup',
'markdown==3.4.3',
'bleach==5.0.*',
'sentry-sdk==1.15.*',
'babel',
'paypalrestsdk==1.13.*',
'pycparser==2.21',
'django-redis==5.2.*',
'redis==4.5.*,>=4.5.4',
'stripe==5.4.*',
'chardet==5.1.*',
'mt-940==4.30.*',
'django-i18nfield==1.9.*,>=1.9.4',
'psycopg2-binary',
'tqdm==4.*',
'vobject==0.9.*',
'pycountry',
'django-countries==7.5.*',
'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.*',
'openpyxl==3.1.*',
'django-oauth-toolkit==1.6.*',
'oauthlib==3.2.*',
'django-phonenumber-field==7.1.*',
'phonenumberslite==8.13.*',
'python-bidi==0.4.*', # Support for Arabic in reportlab
'arabic-reshaper==3.0.0', # Support for Arabic in reportlab
'packaging',
'tlds>=2020041600',
'text-unidecode==1.*',
'protobuf==4.23.*',
'cryptography>=3.4.2',
'sepaxml==2.6.*',
]

[project.optional-dependencies]
memcached = ["pylibmc"]
dev = [
'django-debug-toolbar==4.0.*',
'pycodestyle==2.10.*',
'pyflakes==3.0.*',
'flake8==6.0.*',
'pep8-naming==0.13.*',
'coveralls',
'coverage',
'pytest==7.3.*',
'pytest-django==4.*',
'pytest-xdist==3.3.*',
'isort==5.12.*',
'pytest-mock==3.10.*',
'pytest-rerunfailures==11.*',
'responses',
'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()
Loading

0 comments on commit 3f88eb0

Please sign in to comment.