Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Use newer setuptools_scm for versioning #94

Merged
merged 12 commits into from
Jun 19, 2021
2 changes: 0 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ current_version = 0.2.1
commit = True
tag = True

[bumpversion:file:setup.cfg]

[bumpversion:file:README.md]

[bumpversion:file:.zenodo.json]
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -53,6 +55,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build Docker image
run: |
docker build . --file docker/Dockerfile --tag pylhe/pylhe:$GITHUB_SHA
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
src/pylhe/_version.py
MANIFEST
build
dist
Expand Down
15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = [
"wheel",
"setuptools>=30.3.0",
"attrs>=17.1",
"setuptools_scm>=1.15.0",
"setuptools_scm_git_archive>=1.0",
]
requires = ["wheel", "setuptools>=30.3.0", "attrs>=17.1", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/pylhe/_version.py"
local_scheme = "no-local-version"

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
extend-exclude = '''
/(
\.git
| .eggs
| build
| src/pylhe/_version.py
)/
'''

Expand Down
4 changes: 0 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[metadata]
name = pylhe
version = 0.2.1
description = small package to get structured data out of Les Houches Event files
long_description = file: README.md
long_description_content_type = text/markdown
Expand All @@ -26,9 +25,6 @@ classifiers =
Programming Language :: Python :: 3.9

[options]
setup_requires =
setuptools_scm>=1.15.0
setuptools_scm_git_archive>=1.0
package_dir =
= src
packages = find:
Expand Down
2 changes: 2 additions & 0 deletions src/pylhe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import tex2pix
from particle.converters.bimap import DirectionalMaps

from ._version import version as __version__
from .awkward import register_awkward, to_awkward

__all__ = [
"__version__",
"LHEEvent",
"LHEEventInfo",
"LHEFile",
Expand Down
5 changes: 5 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test_top_level_api():
"LHEInit",
"LHEParticle",
"LHEProcInfo",
"__version__",
"loads",
"read_lhe",
"read_lhe_init",
Expand All @@ -32,3 +33,7 @@ def test_top_level_api():
@python37plus_only
def test_awkward_api():
assert dir(pylhe.awkward) == ["register_awkward", "to_awkward"]


def test_load_version():
assert pylhe.__version__