Skip to content

Commit

Permalink
MNT: Use pyproject.toml instead of setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Sep 5, 2022
1 parent 3db3938 commit 5bc1005
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 87 deletions.
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
max-line-length = 88
ignore =
C408 # Unnecessary dict/list/tuple call - rewrite as a literal
E203 # whitespace before ':' - doesn't work well with black
E225 # missing whitespace around operator - let black worry about that
W503 # line break occurred before a binary operator - let black worry about that
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
. testenv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install -e . --no-use-pep517 || python -m pip install -e .
python -m pip install -e .
python -m pip install -r requirements-test.txt
- name: Test
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
fi;
conda create -n test $INSTALL_DEPS
source activate test
python -m pip install -e . --no-use-pep517 || python -m pip install -e .
python -m pip install -e .
python -m pip install -r requirements-test.txt
- name: Check and Log Environment
Expand Down
33 changes: 17 additions & 16 deletions pyproj/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,7 @@
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
__version__ = "3.4.0.dev0"
__all__ = [
"Proj",
"Geod",
"CRS",
"Transformer",
"transform",
"itransform",
"pj_ellps",
"pj_list",
"get_ellps_map",
"get_prime_meridians_map",
"get_proj_operations_map",
"get_units_map",
"show_versions",
]
import importlib.metadata
import warnings

import pyproj.network
Expand Down Expand Up @@ -82,6 +67,22 @@
transform,
)

__version__ = importlib.metadata.version(__package__)
__all__ = [
"Proj",
"Geod",
"CRS",
"Transformer",
"transform",
"itransform",
"pj_ellps",
"pj_list",
"get_ellps_map",
"get_prime_meridians_map",
"get_proj_operations_map",
"get_units_map",
"show_versions",
]
__proj_version__ = proj_version_str


Expand Down
60 changes: 57 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel", "cython>=0.28.4"]
requires = ["setuptools>=61.0.0", "wheel", "cython>=0.28.4"]

[project]
name = "pyproj"
version = "3.4.0.dev0"
description = "Python interface to PROJ (cartographic projections and coordinate transformations library)"
readme = "README.md"
authors = [
{name = "Jeff Whitaker", email = "jeffrey.s.whitaker@noaa.gov"},
]
license = {file = "LICENSE"}
keywords = [
"GIS",
"map",
"geospatial",
"coordinate-systems",
"coordinate-transformation",
"cartographic-projection",
"geodesic",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independe",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
requires-python = ">=3.8"
dependencies = [
"certifi",
]

[project.urls]
homepage = "https://pyproj4.github.io/pyproj/"
documentation = "https://pyproj4.github.io/pyproj/"
repository = "https://github.com/pyproj4/pyproj"
changelog = "https://pyproj4.github.io/pyproj/stable/history.html"

[project.scripts]
pyproj = "pyproj.__main__:main"

[tool.setuptools.packages.find]
include = [
"pyproj",
"pyproj.*",
]

[tool.black]
target_version = ['py38']
target_version = ["py38"]
53 changes: 0 additions & 53 deletions setup.cfg

This file was deleted.

13 changes: 0 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,8 @@ def get_package_data() -> Dict[str, List[str]]:
return package_data


def get_version():
"""
retreive pyproj version information (taken from Fiona)
"""
with open(Path("pyproj", "__init__.py"), "r") as f:
for line in f:
if line.find("__version__") >= 0:
# parse __version__ and remove surrounding " or '
return line.split("=")[1].strip()[1:-1]
raise SystemExit("ERROR: pyproj version not found.")


# static items in setup.cfg
setup(
version=get_version(),
ext_modules=get_extension_modules(),
package_data=get_package_data(),
)

0 comments on commit 5bc1005

Please sign in to comment.