Skip to content

Commit a82d093

Browse files
asgloverAustin Glover
andauthored
Pypi release (#124)
* for testing "build" * added metadata * add dynamic versioning * add workflow for test.pypi uploads * add test that metadata and __version__ are the same * record minimum torch version * rename to release.yaml, change to pypi vs test.pypi * --sdist only --------- Co-authored-by: Austin Glover <austin_glover@berkeley.com>
1 parent 26aab9a commit a82d093

4 files changed

Lines changed: 76 additions & 3 deletions

File tree

.github/workflows/release.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Upload Python Package
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# ref: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
7+
8+
jobs:
9+
build:
10+
name: Build distribution
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: 3.10
18+
- name: install dependencies, then build source tarball
19+
run: |
20+
python3 -m pip install build --user
21+
python3 -m build --sdist
22+
- name: store the distribution packages
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: python-package-distributions
26+
path: dist/
27+
28+
pypi-publish:
29+
name: Upload release to PyPI
30+
runs-on: ubuntu-latest
31+
# build task to be completed first
32+
needs: build
33+
# Specifying a GitHub environment is optional, but strongly encouraged
34+
environment:
35+
name: pypi
36+
url: https://pypi.org/p/openequivariance
37+
permissions:
38+
# IMPORTANT: this permission is mandatory for Trusted Publishing
39+
id-token: write
40+
steps:
41+
- name: download the distributions
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: python-package-distributions
45+
path: dist/
46+
- name: publish package distributions to PyPI
47+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
__pycache__
88

99
# working folders
10+
dist
1011
build
1112
outputs/*
1213
visualization/*

pyproject.toml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["setuptools"]
2+
requires = ["setuptools", "setuptools-scm"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "openequivariance"
7-
version = "0.1.0"
7+
dynamic = ["version"]
88
authors = [
99
{ name="Austin Glover" },
1010
{ name="Vivek Bharadwaj" },
@@ -17,8 +17,26 @@ dependencies = [
1717
"ninja",
1818
"jinja2",
1919
"numpy",
20-
"torch",
20+
"torch >= 2.4",
2121
]
22+
readme = "README.md"
23+
24+
license = "BSD-3-Clause"
25+
license-files = ["LICENSE"]
26+
27+
classifiers = [
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
]
34+
35+
[project.urls]
36+
homepage = "https://passionlab.github.io/OpenEquivariance/"
37+
source = "https://github.com/PASSIONLab/OpenEquivariance"
38+
issues = "https://github.com/PASSIONLab/OpenEquivariance/issues"
39+
2240

2341
[project.optional-dependencies]
2442
bench = [
@@ -46,6 +64,9 @@ dev = [
4664
[tool.setuptools.packages.find]
4765
include = ["openequivariance*"]
4866

67+
[tool.setuptools_scm]
68+
# Presence of this section necessary, even if empty
69+
4970
[tool.pytest.ini_options]
5071
addopts = [
5172
"--import-mode=importlib",

tests/import_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
from importlib.metadata import version
2+
3+
14
def test_import():
25
import openequivariance
36

47
assert openequivariance.__version__ is not None
58
assert openequivariance.__version__ != "0.0.0"
9+
assert openequivariance.__version__ == version("openequivariance")
610

711

812
def test_tutorial():

0 commit comments

Comments
 (0)