diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 26925cb..5d56733 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,39 +1,20 @@ name: Publish Python 🐍 distributions 📦 to PyPI on: - push: - branches: - - master + release: + types: [published] jobs: build-n-publish: - name: Build and publish Python 🐍 distributions 📦 to PyPI - runs-on: ubuntu-18.04 - if: ${{ contains(github.event.head_commit.message, '#publish') }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Set up Python 3.10 - uses: actions/setup-python@master - with: - python-version: '3.10' - - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.PYPI_API_TOKEN }} + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: python3 -m pip install --upgrade build && python3 -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/LICENSE b/LICENSE index e718b6c..eb3b9bb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Zahner-Elektrik GmbH & Co. KG +Copyright (c) 2024 Zahner-Elektrik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8a36aec --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[build-system] +requires = ["setuptools>=61.0", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "zahner_potentiostat" +authors = [{ name = "Maximilian Krapp", email = "maximilian.krapp@zahner.de" }] +description = "Library to control Zahner Potentiostats." +keywords = [ + "potentiostat", "electrochemistry", "chemistry", "eis", "cyclic voltammetry", "fuel-cell", "battery", +] +readme = "README.md" +license = { file = "LICENSE" } +requires-python = ">=3.9" +dependencies = [ + "matplotlib", "pyserial", "numpy" +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Intended Audience :: Education", + "Intended Audience :: Manufacturing", + + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Chemistry", + "Topic :: Scientific/Engineering :: Physics", + + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dynamic = ["version"] + +[project.urls] +"Documentation"= "https://doc.zahner.de/zahner_potentiostat" +"Examples"= "https://github.com/Zahner-elektrik/Zahner-Remote-Python" +"Source Code"= "https://github.com/Zahner-elektrik/zahner_potentiostat" +"Bug Tracker"= "https://github.com/Zahner-elektrik/zahner_potentiostat/issues" +"Homepage" = "https://zahner.de/" + +[tool.setuptools_scm] + +[tool.setuptools.packages.find] +where = ["."] # list of folders that contain the packages (["."] by default) +include = ["zahner_potentiostat*"] # package names should match these glob patterns (["*"] by default) + + diff --git a/setup.py b/setup.py deleted file mode 100644 index 410ed4d..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -import setuptools - -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - - -setuptools.setup( - name="zahner_potentiostat", - version = "1.1.0", - author="Maximilian Krapp", - author_email="maximilian.krapp@zahner.de", - description="Library to control Zahner Potentiostats.", - keywords=["potentiostat, electrochemistry, chemistry, eis, cyclic voltammetry, fuel-cell, battery"], - long_description=long_description, - long_description_content_type="text/markdown", - url="https://zahner.de/", - project_urls={ - "Documentation": "https://doc.zahner.de/zahner_potentiostat/index.html", - "Examples": "https://github.com/Zahner-elektrik/Zahner-Remote-Python", - "Source Code": "https://github.com/Zahner-elektrik/zahner_potentiostat", - "Bug Tracker": "https://github.com/Zahner-elektrik/zahner_potentiostat/issues", - }, - packages=setuptools.find_packages(where="."), - license = "MIT", - classifiers=[ - "Development Status :: 5 - Production/Stable", - - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "Intended Audience :: Education", - "Intended Audience :: Manufacturing", - - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Chemistry", - "Topic :: Scientific/Engineering :: Physics", - - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - python_requires=">=3.9", - platforms="any", - install_requires=["matplotlib", "pyserial", "numpy"], -)