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 4e06a0d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 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
8 changes: 6 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,8 @@ 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"
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 4e06a0d

Please sign in to comment.