Skip to content

Commit

Permalink
ci: set up automatic versioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloitu committed Oct 2, 2024
1 parent 93320e9 commit a352bf7
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 39 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
create-args: >-
python=3.10
- name: Install py-build
- name: Install py-build and setuptools-scm
run: |
python3 -m pip install --upgrade build
micromamba run -n floatcsep python3 -m pip install --upgrade build setuptools-scm
- name: Build
run: |
python3 -m build --sdist --wheel --outdir dist/
micromamba run -n your_env_name python3 -m build --sdist --wheel --outdir dist/
- name: Publish Package
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.idea/
__pycache__

version
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@
<img src='https://readthedocs.org/projects/floatcsep/badge/?version=latest' alt='Documentation Status' />
</a>
<a href='https://github.com/cseptesting/floatcsep/actions/workflows/build-test.yml'>
<img src='https://github.com/cseptesting/floatcsep/actions/workflows/build-test.yml/badge.svg' alt='Documentation Status' />
<img src='https://github.com/cseptesting/floatcsep/actions/workflows/build-test.yml/badge.svg' alt='Build Status' />
</a>
<a href="https://pypi.org/project/floatcsep/">
<img alt="PyPI" src="https://img.shields.io/pypi/v/floatcsep">
</a>
<a href="https://anaconda.org/conda-forge/floatcsep">
<img alt="Conda Version" src="https://img.shields.io/conda/vn/conda-forge/floatcsep">
</a>
<a href="https://codecov.io/gh/cseptesting/floatcsep">
<img src="https://codecov.io/gh/cseptesting/floatcsep/branch/main/graph/badge.svg?token=LI4RSDOKA1" alt="Code Coverage" />
</a>
<a href="https://doi.org/10.5281/zenodo.7953816">
<img src="https://zenodo.org/badge/DOI/10.5281/zenodo.7953816.svg" alt="DOI">
</a>
<img alt="PyPI" src="https://img.shields.io/pypi/v/floatcsep">

<a href="https://codecov.io/gh/cseptesting/floatcsep" >
<img src="https://codecov.io/gh/cseptesting/floatcsep/branch/main/graph/badge.svg?token=LI4RSDOKA1"/>
</a>
<a href="https://doi.org/10.5281/zenodo.7953816"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.7953816.svg" alt="DOI"></a>
</p>

* Set up a testing **experiment** for your earthquake forecasts using authoritative data sources
Expand Down
39 changes: 16 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import sys
from sphinx_gallery.sorting import FileNameSortKey
from importlib.metadata import version as get_version

sys.path.insert(0, os.path.abspath(".."))

Expand All @@ -16,7 +17,8 @@
project = "floatCSEP"
copyright = "2024, Pablo Iturrieta"
author = "Pablo Iturrieta"
release = "v0.2.0"
release = get_version("floatcsep") # Automatically gets the version from setuptools_scm


# -- General configuration ---------------------------------------------------

Expand All @@ -25,8 +27,8 @@
"sphinx.ext.todo",
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
'sphinx_toolbox.github',
'sphinx_toolbox.sidebar_links',
"sphinx_toolbox.github",
"sphinx_toolbox.sidebar_links",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
Expand All @@ -35,10 +37,10 @@
"sphinx_design",
]

github_username = 'cseptesting'
github_repository = 'floatcsep'
github_username = "cseptesting"
github_repository = "floatcsep"

language = 'en'
language = "en"
autosummary_generate = False
autoclass_content = "both"
suppress_warnings = [
Expand Down Expand Up @@ -82,30 +84,21 @@

html_context = {
"github_links": [
("Getting help", "https://github.com/cseptesting/floatcsep/issues"),
(
'Getting help',
"https://github.com/cseptesting/floatcsep/issues"
),
(
'Contributing',
"https://github.com/cseptesting/floatcsep/blob/master/CONTRIBUTING.md"
),
(
'Code of Conduct',
"https://github.com/cseptesting/floatcsep/blob/master/CODE_OF_CONDUCT.md"
),
(
'License',
"https://github.com/cseptesting/floatcsep/blob/master/LICENSE"
"Contributing",
"https://github.com/cseptesting/floatcsep/blob/master/CONTRIBUTING.md",
),
(
'Source Code',
"https://github.com/cseptesting/floatcsep"
"Code of Conduct",
"https://github.com/cseptesting/floatcsep/blob/master/CODE_OF_CONDUCT.md",
),
("License", "https://github.com/cseptesting/floatcsep/blob/master/LICENSE"),
("Source Code", "https://github.com/cseptesting/floatcsep"),
],
}
extlinks = {
'github_contrib': ('https://github.com/cseptesting/floatcsep/main/blob/%s', ''),
"github_contrib": ("https://github.com/cseptesting/floatcsep/main/blob/%s", ""),
}
rst_epilog = """
.. raw:: html
Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=52.0", "wheel"]
requires = ["setuptools>=52.0", "wheel", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
Expand All @@ -16,4 +16,9 @@ target-version = ["py39", "py310", "py311"]

[tool.flake8]
ignore = ["E203", "W503", "F401"]
max-line-length = 96
max-line-length = 96

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "no-local-version"
fallback_version = "0.2.0"
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pyyaml
requests
scipy
seaborn
setuptools-scm
shapely
sphinx
sphinx-autoapi
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ long_description_content_type = text/markdown
author = Pablo Iturrieta
author_email = [email protected]
license = BSD 3-Clause License
version = 0.1.4
version = attr: setuptools_scm.get_version
platforms = unix, linux, osx, win32
classifiers =
Programming Language :: Python :: 3
Expand Down Expand Up @@ -69,6 +69,7 @@ dev =
requests
scipy
seaborn
setuptools-scm
shapely
sphinx
sphinx-autoapi
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from setuptools import setup

if __name__ == "__main__":
setup()
setup(
name="floatcsep",
use_scm_version=True,
setup_requires=["setuptools-scm"],
)

0 comments on commit a352bf7

Please sign in to comment.