Skip to content

Commit

Permalink
ADD: Add versioning files (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrover1 authored Jan 23, 2024
1 parent cdb8af6 commit d8ccbb3
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,

* @nocollier
* @mgrover1
35 changes: 35 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish intake-esgf to PyPI

on:
release:
types:
- published

jobs:
deploy:
if: github.repository == 'esgf2-us/intake-esgf'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools-scm wheel twine check-manifest
- name: Build tarball and wheels
run: |
git clean -xdf
git restore -SW .
python -m build --sdist --wheel .
- name: Test the artifacts
run: |
python -m twine check dist/*
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
6 changes: 6 additions & 0 deletions intake_esgf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import warnings

import xarray as xr
from pkg_resources import DistributionNotFound, get_distribution

warnings.simplefilter("ignore", category=xr.SerializationWarning)

Expand All @@ -26,3 +27,8 @@ def in_notebook() -> bool:
from intake_esgf.catalog import ESGFCatalog # noqa

__all__ = ["ESGFCatalog", "IN_NOTEBOOK"]

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound: # pragma: no cover
__version__ = "0.0.0" # pragma: no cover
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# https://snarky.ca/what-the-heck-is-pyproject-toml/

[build-system]
requires = ["setuptools"]
requires = ["setuptools", "setuptools_scm", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "no-guess-dev"

[tool.coverage.run]
omit = ["*/intake_esgf/tests/*"]

Expand Down

0 comments on commit d8ccbb3

Please sign in to comment.