Skip to content

Commit

Permalink
Use pyproject.toml and src rootdir (#48)
Browse files Browse the repository at this point in the history
* Use pyproject.toml instead of setup.py
  • Loading branch information
sandorkertesz authored May 8, 2024
1 parent d9452ba commit 75a419e
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 76 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/notify-new-issue.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Notify new issue
# name: Notify new issue

on:
issues:
types:
- "opened"
# on:
# issues:
# types:
# - "opened"

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Notify new issue
uses: ecmwf-actions/notify-teams-issue@v1
with:
incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}
# jobs:
# notify:
# runs-on: ubuntu-latest
# steps:
# - name: Notify new issue
# uses: ecmwf-actions/notify-teams-issue@v1
# with:
# incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}
26 changes: 13 additions & 13 deletions .github/workflows/notify-new-pr.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Notify new PR
# name: Notify new PR

on:
pull_request_target:
types:
- "opened"
# on:
# pull_request_target:
# types:
# - "opened"

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Notify new PR
uses: ecmwf-actions/notify-teams-pr@v1
with:
incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}
# jobs:
# notify:
# runs-on: ubuntu-latest
# steps:
# - name: Notify new PR
# uses: ecmwf-actions/notify-teams-pr@v1
# with:
# incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# setuptools-scm
earthkit/version.py
version.py
_version.py

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
55 changes: 48 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,49 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
requires = ["setuptools>=61", "setuptools-scm>=8.0"]

[project]
authors = [
{name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "software.support@ecmwf.int"}
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: OS Independent"
]
dependencies = [
"earthkit-data[all]>=0.7.0",
"earthkit-geo>=0.1.0",
"earthkit-maps>=0.0.18",
"earthkit-meteo>=0.1.0",
"earthkit-plots>=0.0.6",
"earthkit-regrid>=0.3.0"
]
description = "A format-agnostic Python interface for geospatial data"
dynamic = ["version"]
license = {text = "Apache License Version 2.0"}
name = "earthkit"
readme = "README.md"
requires-python = ">= 3.8"

[project.optional-dependencies]
test = ["pytest"]

[project.urls]
Documentation = "https://earthkit.readthedocs.io/"
Homepage = "https://github.com/ecmwf/earthkit/"
Issues = "https://github.com/ecmwf/earthkit.issues"
Repository = "https://github.com/ecmwf/earthkit/"

[tool.coverage.run]
branch = true
branch = "true"

[tool.isort]
profile = "black"
Expand All @@ -11,9 +52,9 @@ profile = "black"
add_ignore = ["D1", "D200", "D205", "D400", "D401"]
convention = "numpy"

[tool.setuptools.packages.find]
include = ["earthkit", "earthkit.*"]
where = ["src/", "./"]

[tool.setuptools_scm]
write_to = "earthkit/version.py"
write_to_template = '''
# Do not change! Do not track in version control!
__version__ = "{version}"
'''
version_file = "src/earthkit/_version.py"
40 changes: 0 additions & 40 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
[metadata]
name = earthkit
license = Apache License 2.0
url = https://github.com/ecmwf/earthkit
author = European Centre for Medium-Range Weather Forecasts (ECMWF)
author_email = software.support@ecmwf.int
classifiers =
Development Status :: 2 - Pre-Alpha
Intended Audience :: Science/Research
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Scientific/Engineering
long_description_content_type = text/markdown
long_description = file: README.md
test_suite = tests

[options]
python-requires = >=3.8
packages = find_namespace:
install_requires =
earthkit-data[all]>=0.7.0
earthkit-geo>=0.1.0
earthkit-maps>=0.0.18
earthkit-meteo>=0.1.0
earthkit-plots>=0.0.6
earthkit-regrid>=0.3.0

[options.packages.find]
include = earthkit, earthkit.*

[flake8]
max-line-length = 110
extend-ignore = E203, W503

[mypy]
strict = False
ignore_missing_imports = True
4 changes: 2 additions & 2 deletions earthkit/__init__.py → src/earthkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@


try:
# NOTE: the `version.py` file must not be present in the git repository
# NOTE: the `_version.py` file must not be present in the git repository
# as it is generated by setuptools at install time
from .version import __version__
from ._version import __version__
except ImportError: # pragma: no cover
# Local copy or not installed with setuptools
__version__ = "999"
Expand Down

0 comments on commit 75a419e

Please sign in to comment.