From 90b1fc9e0d318778cccf04b2165c09f30850fa18 Mon Sep 17 00:00:00 2001 From: Olle Vidner Date: Fri, 13 Oct 2023 22:29:16 +0200 Subject: [PATCH 1/2] Replace setuptools with Hatch --- MANIFEST.in | 2 -- pyproject.toml | 48 +++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 51 -------------------------------------------------- 3 files changed, 48 insertions(+), 53 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 04f196a..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include README.md -include LICENSE diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9833169 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,48 @@ +[build-system] +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + +[project] +name = "pyDOE2" +dynamic = ["version"] +description = "Design of experiments for Python" +readme = "README.md" +authors = [{ name = "Rickard Sjoegren", email = "r.sjogren89@gmail.com" }] +license = "BSD-3-Clause" +keywords = [ + "DOE", + "design of experiments", + "experimental design", + "optimization", + "statistics", + "python", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.2", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Topic :: Education", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Utilities", +] +dependencies = ["numpy", "scipy"] + +[project.urls] +source = "https://github.com/clicumu/pyDOE2" + +[tool.hatch.version] +source = "vcs" diff --git a/setup.py b/setup.py deleted file mode 100644 index dd089ff..0000000 --- a/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -from io import open -from setuptools import setup - -def read(fname, encoding='utf-8'): - with open(fname, encoding=encoding) as f: - return f.read() - -setup( - name='pyDOE2', - version="1.2.1", - author='Rickard Sjoegren', - author_email='r.sjogren89@gmail.com', - description='Design of experiments for Python', - url='https://github.com/clicumu/pyDOE2', - license='BSD License (3-Clause)', - long_description=read('README.md'), - long_description_content_type='text/markdown', - packages=['pyDOE2'], - install_requires=['numpy', 'scipy'], - keywords=[ - 'DOE', - 'design of experiments', - 'experimental design', - 'optimization', - 'statistics', - 'python' - ], - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Education', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Topic :: Education', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Mathematics', - 'Topic :: Scientific/Engineering :: Physics', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Utilities' - ] - ) - From 19fd52348daa0c5e74f44bb1f37aee59d7ec9923 Mon Sep 17 00:00:00 2001 From: Olle Vidner Date: Fri, 13 Oct 2023 22:29:56 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Add=20workflow=20for=20automagic=20PyPI=20r?= =?UTF-8?q?eleases=20=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-pypi.yml | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/release-pypi.yml diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml new file mode 100644 index 0000000..186020e --- /dev/null +++ b/.github/workflows/release-pypi.yml @@ -0,0 +1,37 @@ +name: Release to PyPI + +on: + release: + types: [published] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + release: + runs-on: ubuntu-latest + environment: pypi + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/checkout@v4 + with: + # Include all history to get tags for versioning + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install hatch + - name: Build package + run: hatch build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1