From 934ff2a3c02c12467b3656928e6daaaa5bd297fb Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 20:44:06 +0200 Subject: [PATCH 1/9] pyproject --- deploy.sh | 5 --- pyproject.toml | 43 ++++++++++++++++++++ setup.cfg | 2 - setup.py | 104 ------------------------------------------------- 4 files changed, 43 insertions(+), 111 deletions(-) delete mode 100644 deploy.sh create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index 701a88b..0000000 --- a/deploy.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -pip install twine -python setup.py sdist -twine check dist/* -python -m twine upload dist/* --username tommyod --password $TWINE --skip-existing \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..16e752b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "streprogen" +dynamic = ["version", "readme"] +description = "The Python strength program generator." +authors = [ + {name = "Tommy Odland", email = "tommy.odland@gmail.com"}, +] +license = {file = "LICENSE"} +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Healthcare Industry", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +keywords = ["strength", "training", "program", "health", "fitness", "generator", "weightlifting", "powerlifting", "exercise"] +requires-python = ">=3.8" + +[project.urls] +Homepage = "https://github.com/tommyod/streprogen" +Repository = "https://github.com/tommyod/streprogen.git" + +[tool.setuptools_scm] +write_to = "streprogen/_version.py" + +[tool.setuptools.dynamic] +readme = {file = ["README.rst"], content-type = "text/x-rst"} + +[tool.setuptools.packages.find] +where = ["."] +include = ["streprogen*"] +exclude = ["contrib", "docs", "tests"] + +[tool.setuptools.package-data] +"streprogen" = ["templates/*", "*.tex", "*.html"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index b88034e..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md diff --git a/setup.py b/setup.py deleted file mode 100644 index c03d25e..0000000 --- a/setup.py +++ /dev/null @@ -1,104 +0,0 @@ -"""A setuptools based setup module. - -See: -https://packaging.python.org/en/latest/distributing.html -https://github.com/pypa/sampleproject -""" - -import re - -# Always prefer setuptools over distutils -from setuptools import setup, find_packages - -# To use a consistent encoding -from codecs import open -from os import path - -here = path.abspath(path.dirname(__file__)) - -# Get version -with open(path.join(here, "streprogen/__init__.py"), encoding="utf-8") as file: - VERSION = re.search(r"__version__ = \"(.*?)\"", file.read()).group(1) - - -def read(fname): - return open(path.join(here, fname)).read() - - -setup( - name="streprogen", - # Versions should comply with PEP440. For a discussion on single-sourcing - # the version across setup.py and the project code, see - # https://packaging.python.org/en/latest/single_source_version.html - version=VERSION, - description="The Python strength program generator.", - long_description=read("README.rst"), - # The project's main homepage. - url="https://github.com/tommyod/streprogen", - # Author details - author="Tommy Odland", - author_email="tommy.odland@gmail.com", - # Choose your license - license="GPLv3", - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - # How mature is this project? Common values are - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - "Development Status :: 4 - Beta", - # Indicate who your project is intended for - "Intended Audience :: End Users/Desktop", - "Intended Audience :: Healthcare Industry", - # Pick your license as you wish (should match "license" above) - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - # Specify the Python versions you support here. In particular, ensure - # that you indicate whether you support Python 2, Python 3 or both. - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], - # What does your project relate to? - keywords="strength training program health fitness generator weightlifting powerlifting exercise", - # You can just specify the packages manually here if your project is - # simple. Or you can use find_packages(). - packages=find_packages(".", exclude=["contrib", "docs", "tests"]), - package_dir={"": "."}, - # Alternatively, if you want to distribute just a my_module.py, uncomment - # this: - # py_modules=["my_module"], - python_requires=">=3.6", - # List run-time dependencies here. These will be installed by pip when - # your project is installed. For an analysis of "install_requires" vs pip's - # requirements files see: - # https://packaging.python.org/en/latest/requirements.html - install_requires=["jinja2>=2.11.2", "ortools>=7.7.7810"], - # List additional groups of dependencies here (e.g. development - # dependencies). You can install these using the following syntax, - # for example: - # $ pip install -e .[dev,test] - # extras_require={ - # 'dev': ['check-manifest'], - # 'test': ['coverage'], - # }, - # If there are data files included in your packages that need to be - # installed, specify them here. If using Python 2.6 or less, then these - # have to be included in MANIFEST.in as well. - # include_package_data=True, - package_data={"": ["templates/*", "*.tex", "*.html"]}, - # Although 'package_data' is the preferred approach, in some case you may - # need to place data files outside of your packages. See: - # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa - # In this case, 'data_file' will be installed into '/my_data' - # data_files=[('my_data', ['data/data_file'])], - # To provide executable scripts, use entry points in preference to the - # "scripts" keyword. Entry points provide cross-platform support and allow - # pip to create the appropriate form of executable for the target platform. - # entry_points={ - # 'console_scripts': [ - # 'sample=sample:main', - # ], - # } -) From b4f46169094b0be49223d5bb579fc8d62f362f84 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 20:45:55 +0200 Subject: [PATCH 2/9] Remove keyword --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 16e752b..d0e9982 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", ] -keywords = ["strength", "training", "program", "health", "fitness", "generator", "weightlifting", "powerlifting", "exercise"] +keywords = ["strength", "training", "health", "fitness", "generator", "weightlifting", "powerlifting", "exercise"] requires-python = ">=3.8" [project.urls] From f21fef10f90dabf06a66db08047aca07edb956c9 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 20:49:25 +0200 Subject: [PATCH 3/9] ignore version --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f309fb..e206db2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,8 +33,8 @@ jobs: run: | sudo apt-get install pandoc -y pip install pip jupyter matplotlib pytest black wheel setuptools twine flake8 --quiet --upgrade - pip install -e . # Install the package - black . --check -l 120 + pip install . # Install the package + black . --check -l 120 --ignore="*_version.py" flake8 streprogen --select=F811,F841,F401,E711,E712,E731 pytest streprogen --doctest-modules --color=yes # Run tests pytest docs/examples --verbose --doctest-modules --color=yes # Run test_notebooks.py From cdcb307822ff236c4324f072b7e36c8af84bebdc Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 20:51:24 +0200 Subject: [PATCH 4/9] exclude --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e206db2..aee6756 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: sudo apt-get install pandoc -y pip install pip jupyter matplotlib pytest black wheel setuptools twine flake8 --quiet --upgrade pip install . # Install the package - black . --check -l 120 --ignore="*_version.py" + black . --check -l 120 --exclude="*_version.py" flake8 streprogen --select=F811,F841,F401,E711,E712,E731 pytest streprogen --doctest-modules --color=yes # Run tests pytest docs/examples --verbose --doctest-modules --color=yes # Run test_notebooks.py From e75ff55e214d2a09ee73bd38f5be1aa759337216 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 20:54:38 +0200 Subject: [PATCH 5/9] remove star --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aee6756..3bf9883 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: sudo apt-get install pandoc -y pip install pip jupyter matplotlib pytest black wheel setuptools twine flake8 --quiet --upgrade pip install . # Install the package - black . --check -l 120 --exclude="*_version.py" + black . --check -l 120 --exclude="_version.py" flake8 streprogen --select=F811,F841,F401,E711,E712,E731 pytest streprogen --doctest-modules --color=yes # Run tests pytest docs/examples --verbose --doctest-modules --color=yes # Run test_notebooks.py From dd53717402fe290b894baae3bd8a51473257353f Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 20:59:28 +0200 Subject: [PATCH 6/9] add deps --- pyproject.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d0e9982..0fffab9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,7 @@ -[build-system] +dependencies = [ + "jinja2>=2.11.2", + "ortools>=7.7.7810", +][build-system] requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" @@ -23,6 +26,10 @@ classifiers = [ ] keywords = ["strength", "training", "health", "fitness", "generator", "weightlifting", "powerlifting", "exercise"] requires-python = ">=3.8" +dependencies = [ + "jinja2>=2.11.2", + "ortools>=7.7.7810", +] [project.urls] Homepage = "https://github.com/tommyod/streprogen" From fd8749965998cb55d11b5929e04a26aa994ce0f0 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 21:01:01 +0200 Subject: [PATCH 7/9] typo --- pyproject.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0fffab9..78e0499 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,4 @@ -dependencies = [ - "jinja2>=2.11.2", - "ortools>=7.7.7810", -][build-system] +[build-system] requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" From 1a23c6881000652ac80f2efb6f2a619936ce8249 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 21:04:51 +0200 Subject: [PATCH 8/9] build without setup.py --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3bf9883..0e35d95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,8 @@ jobs: - name: Build package ${{ matrix.python-version }} run: | - python setup.py sdist bdist_wheel; + python -m pip install build; + python -m build; - name: Publish Python distribution to PyPI if: github.ref == 'refs/heads/master' From d65211d0d79f442df4e0d18043657192dd6d7ae7 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 21:12:48 +0200 Subject: [PATCH 9/9] increment version --- streprogen/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streprogen/__init__.py b/streprogen/__init__.py index d817fdb..bf1d325 100644 --- a/streprogen/__init__.py +++ b/streprogen/__init__.py @@ -18,7 +18,7 @@ from streprogen.program import Program from streprogen.sampling import sample_markov_ladder, sample_markov_loop -__version__ = "4.0.0" +__version__ = "4.0.1" __all__ = [ "StaticExercise",