Skip to content

Commit

Permalink
Merge pull request #75 from sfinkens/pyproject-toml
Browse files Browse the repository at this point in the history
Switch to pyproject.toml
  • Loading branch information
mraspaud authored Nov 22, 2024
2 parents 1fb6245 + 8f96a05 commit f427e3f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 2,920 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy-sdist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:

- name: Create sdist
shell: bash -l {0}
run: python setup.py sdist
run: |
python -m pip install -q build
python -m build
- name: Publish package to PyPI
if: github.event.action == 'published'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
trollsift/version.py

# Jupyter Notebook
.ipynb_checkpoints
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[project]

name = "trollsift"
description = "String parser/formatter"
readme = "README.rst"
authors = [
{ name = "The Pytroll Team", email = "[email protected]" }
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering"
]
keywords = ["string parsing", "string formatting", "pytroll"]
requires-python = ">=3.6"
dependencies = []
dynamic = ["version"]

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.metadata]
allow-direct-references = true

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

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "trollsift/version.py"

[tool.coverage.run]
relative_files = true
omit = ["trollsift/version.py"]
53 changes: 0 additions & 53 deletions setup.py

This file was deleted.

10 changes: 7 additions & 3 deletions trollsift/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

from .parser import *

from .version import get_versions
__version__ = get_versions()['version']
del get_versions
try:
from trollsift.version import version as __version__ # noqa
except ModuleNotFoundError: # pragma: no cover
raise ModuleNotFoundError(
"No module named trollsift.version. This could mean "
"you didn't install 'trollsift' properly. Try reinstalling ('pip "
"install').")
Loading

0 comments on commit f427e3f

Please sign in to comment.