Skip to content

Commit

Permalink
build: update versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejnovak committed Jan 10, 2022
1 parent 9a7b215 commit 479bbbf
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/CD.yml → .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
release:
types:
- published
Expand Down
2 changes: 2 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ python:
version: 3.7
install:
- requirements: docs/requirements.txt
- method: pip
path: .
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[build-system]
# Minimum requirements for the build system (setup.py) to execute.
requires = ["wheel", "setuptools>=39.2.0"]
requires = ["wheel", "setuptools>=42", "setuptools_scm[toml]>=3.4",]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/mplhep/_version.py"

[tool.nbqa.config]
black = "pyproject.toml"

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = mplhep
version = file: src/mplhep/.VERSION
# version = file: src/mplhep/.VERSION
long_description = file: README.md
long_description_content_type = text/markdown
author = andrzejnovak
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import setuptools_scm # noqa: F401
from setuptools import setup

extras_require = {
Expand Down
1 change: 0 additions & 1 deletion src/mplhep/.VERSION

This file was deleted.

7 changes: 1 addition & 6 deletions src/mplhep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from . import alice, atlas, cms, label, lhcb, plot
from . import styles as style
from ._tools import Config
from ._version import version as __version__ # noqa: F401
from .label import save_variations, savelabels
from .plot import (
append_axes,
Expand Down Expand Up @@ -41,12 +42,6 @@
),
)

# Make __version__ available
_base_dir = os.path.dirname(os.path.abspath(__file__))

with open(os.path.join(_base_dir, ".VERSION")) as version_file:
__version__ = version_file.read().strip()

path = os.path.abspath(__file__)
font_path = os.path.join(os.path.dirname(mplhep_data.__file__), "fonts")
font_files = fm.findSystemFonts(fontpaths=font_path)
Expand Down
2 changes: 2 additions & 0 deletions src/mplhep/version.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: str
version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]

0 comments on commit 479bbbf

Please sign in to comment.