Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Move project metadata to pyproject.toml

Roland Geider8da48f87bdf9
diff --git a/extras/docker/demo/Dockerfile b/extras/docker/demo/Dockerfile
index 43a87eb1f..333167bbf 100644
--- a/extras/docker/demo/Dockerfile
+++ b/extras/docker/demo/Dockerfile
@@ -89,7 +89,7 @@ RUN python3 -m venv /home/wger/venv
RUN . /home/wger/venv/bin/activate \
&& pip install --upgrade pip \
&& pip install --no-cache /wheels/* \
- && python setup.py develop \
+ && pip install -e . \
&& wger create-settings --database-path /home/wger/db/database.sqlite \
&& wger bootstrap \
&& wger load-online-fixtures \
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 000000000..be5b0ccb3
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,112 @@
+[build-system]
+requires = ["setuptools>=61.2"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "wger"
+version = "2.3.0a1"
+dynamic = ["dependencies"]
+authors = [
+ { name = "Roland Geider", email = "[email protected]" },
+]
+description = "FLOSS workout, fitness and weight manager/tracker"
+readme = "README.md"
+requires-python = ">=3.9"
+classifiers = [
+ # http://pypi.python.org/pypi?%3Aaction=list_classifiers
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Other Audience',
+ 'Framework :: Django',
+ 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11',
+ 'Programming Language :: Python :: 3.12',
+]
+
+[project.urls]
+Homepage = "https://wger.de/"
+Documentation = "https://wger.readthedocs.io/en/latest/"
+Repository = "https://github.com/wger-project/wger"
+Issues = "https://github.com/wger-project/wger/issues"
+Changelog = "https://wger.readthedocs.io/en/latest/changelog.html"
+
+[project.scripts]
+wger = "wger.__main__:main"
+
+[tool.setuptools]
+include-package-data = false
+packages = ["wger"]
+
+[tool.setuptools.dynamic]
+dependencies = { file = ["requirements.txt"] }
+
+[tool.distutils.bdist_wheel]
+universal = 1
+
+[tool.isort]
+sections = ["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
+skip = ["extras", "build", "dist", "node_modules", "migrations", "docs", "settings.py", "apps.py"]
+# If set to true - ensures that if a star import is present, nothing else is
+# imported from that namespace.
+combine_star = false
+# If set to true - imports will be sorted by their length instead of
+# alphabetically.
+length_sort = false
+# An integer that represents the longest line-length you want a single import to
+# take. Defaults to 80.
+line_length = 119
+# A comment to consistently place directly above future imports.
+import_heading_future = "Future"
+# A comment to consistently place directly above django imports.
+import_heading_django = "Django"
+# A comment to consistently place directly above imports from the standard library.
+import_heading_stdlib = "Standard Library"
+# A comment to consistently place directly above third-party imports.
+import_heading_thirdparty = "Third Party"
+# A comment to consistently place directly above wger imports.
+import_heading_firstparty = "wger"
+# A comment to consistently place directly above imports that start with '.'.
+import_heading_localfolder = "Local"
+# An integer that represents the number of spaces you would like to indent by or
+# Tab to indent by a single tab.
+indent = "' '"
+# A list of imports that will be forced to display within the first party
+# category.
+known_first_party = ["wger"]
+known_django = ["django"]
+# An integer that represents how you want imports to be displayed if they're long
+# enough to span multiple lines. A full definition of all possible modes can be
+# found in isort's README.
+multi_line_output = 3
+force_grid_wrap = true
+# If set to true - isort will create separate sections within "from" imports
+# for CONSTANTS, Classes, and modules/functions.
+order_by_type = true
+# Forces a certain number of lines after the imports and before the first line
+# of functional code. By default, this is 2 lines if the first line of code is a
+# class or function. Otherwise, it's 1.
+lines_after_imports = 2
+# If set to true - isort will combine as imports on the same line within for
+# import statements. By default, isort forces all as imports to display on their
+# own lines.
+combine_as_imports = true
+# If set to true - isort will add imports even if the file specified is
+# currently completely empty.
+force_adds = false
+# Include a trailing comma after the imports. This ensures that yapf doesn't
+# reformat the code
+include_trailing_comma = true
+
+[tool.yapf]
+based_on_style = "pep8"
+column_limit = "100"
+blank_line_before_nested_class_or_def = "True"
+dedent_closing_brackets = "True"
+split_penalty_import_names = "100"
+# # Too much...
+# split_all_comma_separated_values = True
+
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 07fbdb4d7..000000000
--- a/setup.cfg
+++ /dev/null
@@ -1,83 +0,0 @@
-[bdist_wheel]
-universal = 1
-
-[isort]
-sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
-skip: extras,build,dist,node_modules,migrations,docs,settings.py,apps.py
-
-# If set to true - ensures that if a star import is present, nothing else is
-# imported from that namespace.
-combine_star=False
-
-# If set to true - imports will be sorted by their length instead of
-# alphabetically.
-length_sort=False
-
-# An integer that represents the longest line-length you want a single import to
-# take. Defaults to 80.
-line_length=119
-
-# A comment to consistently place directly above future imports.
-import_heading_future=Future
-
-# A comment to consistently place directly above django imports.
-import_heading_django=Django
-
-# A comment to consistently place directly above imports from the standard library.
-import_heading_stdlib=Standard Library
-
-# A comment to consistently place directly above third-party imports.
-import_heading_thirdparty=Third Party
-
-# A comment to consistently place directly above wger imports.
-import_heading_firstparty=wger
-
-# A comment to consistently place directly above imports that start with '.'.
-import_heading_localfolder=Local
-
-# An integer that represents the number of spaces you would like to indent by or
-# Tab to indent by a single tab.
-indent=' '
-
-# A list of imports that will be forced to display within the first party
-# category.
-known_first_party=wger
-known_django=django
-
-# An integer that represents how you want imports to be displayed if they're long
-# enough to span multiple lines. A full definition of all possible modes can be
-# found in isort's README.
-multi_line_output=3
-force_grid_wrap=True
-
-# If set to true - isort will create separate sections within "from" imports
-# for CONSTANTS, Classes, and modules/functions.
-order_by_type=True
-
-# Forces a certain number of lines after the imports and before the first line
-# of functional code. By default this is 2 lines if the first line of code is a
-# class or function. Otherwise it's 1.
-lines_after_imports=2
-
-# If set to true - isort will combine as imports on the same line within for
-# import statements. By default isort forces all as imports to display on their
-# own lines.
-combine_as_imports=True
-
-# If set to true - isort will add imports even if the file specified is
-# currently completely empty.
-force_adds=False
-
-# Include a trailing comma after the imports. This ensures that yapf doesn't
-# reformat the code
-include_trailing_comma = True
-
-[yapf]
-based_on_style = pep8
-column_limit = 100
-blank_line_before_nested_class_or_def = True
-dedent_closing_brackets = True
-split_penalty_import_names = 100
-
-## Too much...
-#split_all_comma_separated_values = True
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 14189d422..000000000
--- a/setup.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
- Setup script for wger Workout manager
-
- :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
- :license: GNU GPL, see LICENSE for more details.
-"""
-
-# Third Party
-from setuptools import (
- find_packages,
- setup,
-)
-
-# wger
-from wger import get_version
-
-
-with open('README.md', encoding="utf8") as readme:
- long_description = readme.read()
-
-with open('requirements.txt') as requirements_production:
- install_requires = requirements_production.readlines()
-
-setup(
- name='wger',
- description='FLOSS workout, fitness and weight manager/tracker written with Django',
- long_description=long_description,
- long_description_content_type='text/markdown',
- version=get_version(),
- url='https://github.com/wger-project',
- author='Roland Geider',
- author_email='[email protected]',
- license='AGPL3+',
- packages=find_packages(exclude=['tests']),
- include_package_data=True,
- classifiers=[
- # http://pypi.python.org/pypi?%3Aaction=list_classifiers
- 'Development Status :: 5 - Production/Stable',
- 'Environment :: Web Environment',
- 'Intended Audience :: Other Audience',
- 'Framework :: Django',
- 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
- 'Operating System :: OS Independent',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3.10',
- ],
-
- install_requires=install_requires,
- entry_points={
- 'console_scripts': [
- 'wger = wger.__main__:main',
- ],
- },
-)