diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e6043f0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +jobs: + build-n-publish: + name: Build and publish to PyPI + runs-on: ubuntu-latest + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + contents: read + + steps: + - name: Checkout source + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build distribution + run: python -m build + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index f987c5f..3bda75c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,14 +4,13 @@ build-backend = "setuptools.build_meta" [project] name = "aobasis" -version = "0.1.0" +version = "1.0.0" description = "A package for generating AO basis sets (KL, Zernike, Fourier)" readme = "README.md" -authors = [{ name = "User", email = "user@example.com" }] +authors = [{ name = "Jacob Taylor", email = "jtaylor@keck.hawaii.edu" }] license = { file = "LICENSE" } classifiers = [ "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] dependencies = [ @@ -29,7 +28,8 @@ dev = [ ] [project.urls] -"Homepage" = "https://github.com/example/aobasis" +"Homepage" = "https://github.com/jacotay7/aobasis" +"Bug Tracker" = "https://github.com/jacotay7/aobasis/issues" [tool.setuptools.packages.find] where = ["src"] diff --git a/src/aobasis/__init__.py b/src/aobasis/__init__.py index 6aceda1..e7874db 100644 --- a/src/aobasis/__init__.py +++ b/src/aobasis/__init__.py @@ -1,3 +1,10 @@ +from importlib.metadata import version, PackageNotFoundError + +try: + __version__ = version("aobasis") +except PackageNotFoundError: + __version__ = "unknown" + from .base import BasisGenerator from .kl import KLBasisGenerator from .zernike import ZernikeBasisGenerator