Skip to content

Commit

Permalink
Use pyproject.toml instead of setup.py file
Browse files Browse the repository at this point in the history
Edited publish yml script to automatically publish releases.
  • Loading branch information
maxkrapp1 committed May 24, 2024
1 parent eb7f9a8 commit 77d4986
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 78 deletions.
43 changes: 12 additions & 31 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -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 }}

4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
SOFTWARE.
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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)


45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

0 comments on commit 77d4986

Please sign in to comment.