Convert project to use pyproject.toml

This commit is contained in:
Raphael Michel 2023-05-19 15:53:28 +02:00
parent 5bc8a670f2
commit 510d90a60c
4 changed files with 51 additions and 52 deletions

View file

@ -1,13 +1,11 @@
pypi: pypi:
script: script:
- cp /keys/.pypirc ~/.pypirc - cp /keys/.pypirc ~/.pypirc
- virtualenv env - virtualenv /tmp/env
- source env/bin/activate - source /tmp/env/bin/activate
- XDG_CACHE_HOME=/cache pip3 install -U pip wheel setuptools twine - XDG_CACHE_HOME=/cache pip3 install -U pip wheel setuptools twine build pretix-plugin-build
- XDG_CACHE_HOME=/cache pip3 install -U pretix - python -m build
- XDG_CACHE_HOME=/cache pip3 install -U pkginfo==1.8.3 # Work around https://github.com/pypa/twine/issues/940 - check-manifest .
- python setup.py develop
- python setup.py sdist bdist_wheel
- twine check dist/* - twine check dist/*
- twine upload dist/* - twine upload dist/*
tags: tags:

View file

@ -12,7 +12,7 @@ Development setup
3. Activate the virtual environment you use for pretix development. 3. Activate the virtual environment you use for pretix development.
4. Execute ``python setup.py develop`` within this directory to register this application with pretix's plugin registry. 4. Execute ``pip install -e .`` within this directory to register this application with pretix's plugin registry.
5. Execute ``make`` within this directory to compile translations. 5. Execute ``make`` within this directory to compile translations.

43
pyproject.toml Normal file
View file

@ -0,0 +1,43 @@
[project]
name = "pretix-servicefees"
dynamic = ["version"]
description = "Allows you to impose a service fee on all non-free orders."
readme = "README.rst"
requires-python = ">=3.9"
license = {file = "LICENSE"}
keywords = ["pretix"]
authors = [
{name = "pretix team", email = "support@pretix.eu"},
]
maintainers = [
{name = "pretix team", email = "support@pretix.eu"},
]
dependencies = [
]
[project.entry-points."pretix.plugin"]
pretix_servicefees = "pretix_servicefees:PretixPluginMeta"
[project.entry-points."distutils.commands"]
build = "pretix_plugin_build.build:CustomBuild"
[build-system]
requires = [
"setuptools",
"pretix-plugin-build",
]
[project.urls]
homepage = "https://github.com/pretix/pretix-servicefees"
[tool.setuptools]
include-package-data = true
[tool.setuptools.dynamic]
version = {attr = "pretix_servicefees.__version__"}
[tool.setuptools.packages.find]
include = ["pretix*"]
namespaces = false

View file

@ -1,45 +1,3 @@
import os from setuptools import setup
from distutils.command.build import build
from django.core import management setup()
from setuptools import setup, find_packages
from pretix_servicefees import __version__
try:
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ''
class CustomBuild(build):
def run(self):
management.call_command('compilemessages', verbosity=1)
build.run(self)
cmdclass = {
'build': CustomBuild
}
setup(
name='pretix-servicefees',
version=__version__,
description='Allows you to impose a service fee on all non-free orders.',
long_description=long_description,
url='https://github.com/pretix/pretix-servicefees',
author='Raphael Michel',
author_email='michel@rami.io',
license='Apache Software License',
install_requires=[],
packages=find_packages(exclude=['tests', 'tests.*']),
include_package_data=True,
cmdclass=cmdclass,
entry_points="""
[pretix.plugin]
pretix_servicefees=pretix_servicefees:PretixPluginMeta
""",
)