Skip to content

Commit 701dffe

Browse files
committed
Adding PyPI package upload.
1 parent 0e7d020 commit 701dffe

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

.bumpversion.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[tool.bumpversion]
2+
current_version = "0.1.0"
3+
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
4+
serialize = ["{major}.{minor}.{patch}"]
5+
search = "{current_version}"
6+
replace = "{new_version}"
7+
regex = false
8+
ignore_missing_version = false
9+
ignore_missing_files = false
10+
tag = false
11+
sign_tags = false
12+
tag_name = "v{new_version}"
13+
tag_message = "Bump version: {current_version} → {new_version}"
14+
allow_dirty = false
15+
commit = false
16+
message = "Bump version: {current_version} → {new_version}"
17+
commit_args = ""
18+
setup_hooks = []
19+
pre_commit_hooks = []
20+
post_commit_hooks = []

.github/workflows/pypi.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish to PyPI
2+
3+
jobs:
4+
publish:
5+
runs-on: ubuntu-latest
6+
7+
steps:
8+
- name: Checkout repository
9+
uses: actions/checkout@v4
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: '3.x' # Use latest Python 3
15+
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install build twine
20+
21+
- name: Build package
22+
run: python -m build # Creates dist/* files
23+
24+
- name: Publish package to PyPI
25+
env:
26+
TWINE_USERNAME: __token__
27+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
28+
run: twine upload dist/*

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
[tool.black]
22
line-length = 80
3+
4+
[build-system]
5+
requires = ["setuptools", "wheel"]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "calorimetry_tools"
10+
version = "0.1.0"
11+
description = "Calorimetry tools"
12+
authors = [ { name = "Stephan Grein", email = "stephan.grein@uni-bonn.de" }]
13+
license = { text = "MIT" }
14+
readme = "README.md"
15+
requires-python = ">3.10"
16+
dynamic = ["dependencies"]

setup.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from setuptools import setup
2+
3+
4+
def load_requirements(filename):
5+
"""Load dependencies from requirements.txt"""
6+
with open(filename, "r", encoding="utf-8") as f:
7+
return [
8+
line.strip()
9+
for line in f
10+
if line.strip() and not line.startswith("#")
11+
]
12+
13+
14+
setup(
15+
name="calorimetry_tools",
16+
version="0.1.0",
17+
install_requires=load_requirements("requirements.txt"),
18+
)

0 commit comments

Comments
 (0)