-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from alchem0x2A/master
Add workflow to publish pypi
- Loading branch information
Showing
3 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Publish PyPI package | ||
|
||
on: | ||
# The workflow runs on each push / PR but only allow upload | ||
# PyPI when tagged | ||
release: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-pypi: | ||
name: upload release to PyPI | ||
runs-on: ubuntu-latest | ||
# Specifying a GitHub environment is optional, but strongly encouraged | ||
environment: pypi | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
python-version: "3.10" | ||
mamba-version: "*" | ||
channels: conda-forge,defaults | ||
channel-priority: true | ||
activate-environment: sparc-api-test | ||
- name: Install dependencies | ||
run: | | ||
pip install -U build | ||
- name: Download data | ||
run: | | ||
# Download the external psp data | ||
python -m sparc.download_data | ||
# Check if psp8 exists | ||
ls sparc/psp/*.psp8 | ||
- name: Build wheel | ||
run: | | ||
# Wheels are inside dist/ folder | ||
python -m build | ||
# Check the contents, if psp exists | ||
TMP_DIR=$(mktemp -d) | ||
unzip dist/sparc_x_api-*.whl -d ${TMP_DIR} | ||
find $TMP_DIR/sparc/psp -name "*.psp8" | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: dist/ | ||
if: github.event.release.draft == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,20 +25,16 @@ | |
|
||
setup( | ||
name="sparc-x-api", | ||
version="1.0.4", | ||
version="1.0.5", | ||
python_requires=">=3.8", | ||
description="Python API for the SPARC DFT Code", | ||
author="Tian Tian, Ben Comer", | ||
author_email="[email protected], [email protected]", | ||
author="Tian Tian, Lucas R Timmerman, Ben Comer", | ||
author_email="[email protected], [email protected], [email protected]", | ||
url="https://github.com/SPARC-X/SPARC-X-API", | ||
packages=find_packages(), | ||
# ASE 3.22 dependency will be deprecated in 1.1.0+ release | ||
# ASE 3.22 dependency will be deprecated in 2.0+ release | ||
install_requires=["ase>=3.22.0", "numpy>=1.23", "packaging>=20.0", "psutil>=5.0.0"], | ||
entry_points={ | ||
# TODO: deprecate | ||
"ase.io": [ | ||
"sparc = sparc.io", | ||
], | ||
# The ioformats are only compatible with ase>=3.23 | ||
"ase.ioformats": [ | ||
"sparc = sparc.io:format_sparc", | ||
|
@@ -53,6 +49,6 @@ | |
"test": test_requires, | ||
"doc": test_requires + doc_requires, | ||
}, | ||
package_data={"sparc": ["psp/*", "sparc_json_api/*.json"]}, | ||
package_data={"sparc": ["psp/*.psp8", "sparc_json_api/*.json"]}, | ||
include_package_data=True, | ||
) |