Skip to content

Commit

Permalink
[build] finalize pypi publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
the-hampel committed May 31, 2024
1 parent cccbf97 commit 2a1db34
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 18 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to PyPI
name: PyPI

on:
push:
Expand All @@ -11,31 +11,26 @@ jobs:
name: Build distribution 📦
runs-on: ubuntu-latest
container: # we have to provide a working triqs installation to make the cmake step work
image: flatironinstitute/triqs:${{github.ref_name}}
# image: flatironinstitute/triqs:${{github.ref_name}}
image: flatironinstitute/triqs:latest
options: --user root

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build toml
--user
run: |
pip3 install --user build toml --break-system-packages
- name: prepare python distribution
run: |
mkdir build && cd build
cmake ../
cp packaging/pypi/* ../
mv python/triqs_maxent/version.py ../python/triqs_maxent/version.py
rm ../python/triqs_maxent/version.py.in
git config --global --add safe.directory ${GITHUB_WORKSPACE}
cmake -S . -B build/
cp build/packaging/pypi/* ./
mv build/python/triqs_maxent/version.py ./python/triqs_maxent/version.py
rm ./python/triqs_maxent/version.py.in
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -53,7 +48,7 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down
2 changes: 2 additions & 0 deletions packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
configure_file(conda/meta.yaml.in conda/meta.yaml)
configure_file(conda/build.sh conda/build.sh COPYONLY)
configure_file(conda/conda_build_config.yaml conda/conda_build_config.yaml COPYONLY)
configure_file(pypi/MANIFEST.in pypi/MANIFEST.in COPYONLY)
configure_file(pypi/pyproject.toml.in pypi/pyproject.toml)
configure_file(TRIQS-triqs_maxent-foss-2021b.eb.in TRIQS-triqs_maxent-foss-2021b.eb)


13 changes: 13 additions & 0 deletions packaging/pypi/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
prune test
prune .git
prune .github
prune doc
prune share
prune Docker
prune deps
prune packaging
prune paper
prune bin
prune build

global-exclude .clang-format .clang-tidy .dockerignore .gitignore CMakeLists.txt Jenkinsfile
36 changes: 36 additions & 0 deletions packaging/pypi/pyproject.toml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["python"]

[project]
name = "triqs_maxent"
version = "@PROJECT_VERSION@"
authors = [
{ name="TRIQS", email="[email protected]" }
]
description = "TRIQS application providing a modular Maximum Entropy progra to perform analytic continuation based on the TRIQS library (triqs.github.io)"
readme = "README.md"
keywords = ["triqs", "analytic-continuation", "maximum-entropy"]
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
]
dependencies = [
"numpy",
"scipy",
"matplotlib"
]

[project.urls]
"Homepage" = "https://triqs.github.io/maxent"
"Bug Tracker" = "https://github.com/triqs/maxent/issues"

# in case you want an executable hook of your app
# [project.scripts]
# solid_dmft = "solid_dmft.main:main"

0 comments on commit 2a1db34

Please sign in to comment.