Skip to content

Commit

Permalink
Merge pull request #65 from pjflux2001/main
Browse files Browse the repository at this point in the history
CI workflow for python release
  • Loading branch information
OskarElek authored Oct 28, 2023
2 parents 7122bfe + 11d4411 commit 8640272
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to PyPI

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Check if Python package already exists
run: |
pip install polyphy-testing==$(cat pyproject.toml | head -20 | tail -1 | cut -d '"' -f 2) && echo "true" > ./flag || echo "false" > ./flag
- name: Build and publish package
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
if grep -qF false ./flag; then
python3 -m pip install --upgrade build
python3 -m build
python3 -m pip install --upgrade twine
python3 -m twine upload dist/*
echo "New version is live!!!"
else
echo "Not publishing as the above version already exists!"
fi
47 changes: 44 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,50 @@
[project]
name = "polyphy-testing"
version = "0.0.1"
description = "description for polyphy testing"
readme = "README.md"
requires-python = ">=3.7"
license = {file = "LICENSE"}
keywords = ["polyphy"]
authors = [
{name = "author_name", email = "[email protected]" }
]
maintainers = [
{name = "maintainers_name", email = "[email protected]" }
]

[build-system]
# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# For smarter version schemes and other configuration options,
# check out https://github.com/pypa/setuptools_scm
version_scheme = "no-guess-dev"

[tool.poetry.dependencies]
Sphinx = "4.5.0"
coverage = "*"
flake8 = "*"
isort = "*"
matplotlib = "3.5.3"
nbmake = "*"
numpy = "<=1.22.0"
pytest-cov = "*"
pytest-xdist = "*"
pytest = "7.1.2"
scipy = "*"
setuptools = "65.5.1"
sphinx = "*"
taichi = "1.6.0"
toml = "*"
tox = "*"
yapf = "*"
ipywidgets = "*"
pyvista = "*"
trimesh = "*"
PyMCubes = "*"
scikit-image = "*"
path = "*"

[tool.poetry.dev-dependencies]

[tool.poetry.extras]

0 comments on commit 8640272

Please sign in to comment.