Skip to content

Commit

Permalink
chore: modernize to hatchling backend
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 7, 2024
1 parent d1b0913 commit 836de52
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 86 deletions.
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

70 changes: 65 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,71 @@
[build-system]
# Minimum requirements for the build system (setup.py) to execute.
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "mplhep"
dynamic = ["version"]
description = "Matplotlib styles for HEP"
readme = "README.md"
license = "MIT"
requires-python = ">=3.8"
authors = [
{ name = "andrzejnovak", email = "\"[email protected]\"" },
]
classifiers = [
"Framework :: Matplotlib",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = [
"matplotlib>=3.4",
"mplhep-data",
"numpy>=1.16.0",
"packaging",
"uhi>=0.2.0",
]

[tool.setuptools_scm]
write_to = "src/mplhep/_version.py"
[project.optional-dependencies]
dev = [
"black",
"bumpversion",
"flake8",
"jupyter",
"pre-commit",
"twine",
]
test = [
"boost_histogram",
"hist",
"nteract-scrapbook~=0.3",
"papermill~=1.0",
"pytest-mock",
"pytest-mpl",
"pytest>=6.0",
"scikit-hep-testdata",
"scipy>=1.1.0",
"uproot",
"uproot4",
]
all = [
"mplhep[dev,test]",
]

[project.urls]
Homepage = "https://github.com/scikit-hep/mplhep"


[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/mplhep/_version.py"


[tool.nbqa.mutate]
Expand Down
45 changes: 0 additions & 45 deletions setup.cfg

This file was deleted.

31 changes: 0 additions & 31 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/mplhep/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def dist(tup):
else:
_exp_loc = 1
_formater = ax.get_yaxis().get_major_formatter()
if type(mpl.ticker.ScalarFormatter()) == type(_formater) and _exp_loc == 0:
if isinstance(_formatter, mpl.ticker.ScalarFormatter()) and _exp_loc == 0:
_sci_box = pixel_to_axis(
ax.get_yaxis().offsetText.get_window_extent(ax.figure.canvas.get_renderer())
)
Expand Down

0 comments on commit 836de52

Please sign in to comment.