Skip to content

Commit

Permalink
Migrate to pyproject.toml, update for numpy 2.0 (#39)
Browse files Browse the repository at this point in the history
* move to pyproject file

* remove setup.py

* not needed anymore

* files included by default by Hatch since they are not ignored by VSC

* ensure last empty line

* switch to np.nan for numpy 2.0 compatibility

* and bump patch version for release

* and add to changelog

* update authors metadata as discussed
  • Loading branch information
fsoubelet authored Aug 13, 2024
1 parent 79f4de0 commit ac89efe
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
with:
src-dir: pylhc_submitter
pytest-options: -m "not cern_network"
secrets: inherit
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on: # Runs on any push event in a PR or any push event to master

jobs:
documentation:
uses: pylhc/.github/.github/workflows/documentation.yml@master
uses: pylhc/.github/.github/workflows/documentation.yml@master
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ on: # Runs everytime a release is added to the repository
jobs:
deploy:
uses: pylhc/.github/.github/workflows/publish.yml@master
secrets: inherit
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ jobs:
uses: pylhc/.github/.github/workflows/tests.yml@master
with:
pytest-options: -m "not cern_network"

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# `pylhc-submitter` Changelog

## Version 2.0.4

- Fixed use of `np.NaN` to ensure compatibility with `numpy 2.0`.

## Version 2.0.3

- Fixing `job_submitter`: Do not transfer any output files, when the `output_destination` is given.
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion pylhc_submitter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__title__ = "pylhc_submitter"
__description__ = "pylhc-submitter contains scripts to simplify the creation and submission of jobs to HTCondor at CERN"
__url__ = "https://github.com/pylhc/submitter"
__version__ = "2.0.3"
__version__ = "2.0.4"
__author__ = "pylhc"
__author_email__ = "[email protected]"
__license__ = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion pylhc_submitter/sixdesk_tools/post_process_da.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _plot_seeds(ax, df_da: TfsDataFrame, da_col: str, interpolated: bool) -> Tup
seed_mask = df_da[SEED] == seed
angles = np.deg2rad(df_da.loc[seed_mask, ANGLE])
da_data = df_da.loc[seed_mask, da_col]
da_data.loc[da_data == 0] = np.NaN
da_data.loc[da_data == 0] = np.nan
if interpolated:
seed_h, _, _ = _interpolated_line(
ax,
Expand Down
84 changes: 84 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "pylhc_submitter/__init__.py"

[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/doc",
"/tests",
]

[tool.hatch.build.targets.wheel]
packages = ["pylhc_submitter"]

[project]
name = "pylhc_submitter"
readme = "README.md"
description = "pylhc-submitter contains scripts to simplify the creation and submission of jobs to HTCondor at CERN"
authors = [
{name = "OMC Team", email = "[email protected]"}, # see zenodo file / commits for details
]
license = "MIT"
dynamic = ["version"]
requires-python = ">=3.9"

classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]

dependencies = [
"numpy >= 1.24",
"scipy >= 1.10",
"pandas >= 2.1",
"tfs-pandas >= 3.8",
"matplotlib >= 3.8",
"htcondor >= 8.9.2 ; sys_platform=='linux'", # no bindings for macOS or windows on PyPI
"generic-parser >= 1.1",
]

[project.optional-dependencies]
test = [
"pytest>=7.0",
"pytest-cov>=2.9",
"pytest-mpl>=0.15",
]
doc = [
"sphinx >= 7.0",
"sphinx_rtd_theme >= 2.0",
]

all = [
"pylhc_submitter[test]",
"pylhc_submitter[doc]",
]

[project.urls]
homepage = "https://github.com/pylhc/submitter"
repository = "https://github.com/pylhc/submitter"
documentation = "https://pylhc.github.io/submitter/"
changelog = "https://github.com/pylhc/submitter/blob/master/CHANGELOG.md"

# ----- Testing ----- #

[tool.pytest.ini_options]
markers = [
"cern_network: tests that require access to afs or the technical network",
]
# Helpful for pytest-debugging (leave commented out on commit):
# log_cli=true
# log_level=DEBUG
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

80 changes: 0 additions & 80 deletions setup.py

This file was deleted.

0 comments on commit ac89efe

Please sign in to comment.