Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move static content from setup.py & flake8 options to setup.cfg #699

Merged
merged 2 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ repos:
hooks:
- id: flake8
additional_dependencies: [flake8-comprehensions>=3.1.0]
args: [--max-line-length, '88', --ignore, "E225,W503,C408"]
- id: flake8
name: flake8-pyx
files: \.(pyx|pxd)$
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ clean-cython: ## clean the cython files
rm -f pyproj/*.c

lint: ## check style with flake8
flake8 --max-line-length 88 setup.py pyproj/ test/ docs/
flake8 setup.py pyproj/ test/ docs/
flake8 --append-config=flake8/cython.cfg pyproj/

check-type:
Expand Down
52 changes: 52 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[metadata]
name = pyproj
description = Python interface to PROJ (cartographic projections and coordinate transformations library)
long_description = file: README.md
long_description_content_type = text/markdown
author = Jeff Whitaker
author_email = jeffrey.s.whitaker@noaa.gov
license = MIT
license-file = LICENSE
platform = any
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 Independent
Programming Language :: Python
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3 :: Only
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: GIS
Topic :: Scientific/Engineering :: Mathematics
Topic :: Software Development :: Libraries :: Python Modules
Typing :: Typed
url = https://github.com/pyproj4/pyproj
download_url = http://python.org/pypi/pyproj
project_urls =
Documentation = https://pyproj4.github.io/pyproj/
Release Notes = https://pyproj4.github.io/pyproj/stable/history.html
Bug Tracker = https://github.com/pyproj4/pyproj/issues
Source Code = https://github.com/pyproj4/pyproj

[options]
zip_safe = False # https://mypy.readthedocs.io/en/stable/installed_packages.html
packages = find:
python_requires = >=3.6
install_requires =
certifi

[options.entry_points]
console_scripts =
pyproj = pyproj.__main__:main

[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
44 changes: 3 additions & 41 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_proj_dir():
proj = find_executable("proj")
if proj is None:
raise SystemExit(
"proj executable not found. Please set the PROJ_DIR variable."
"proj executable not found. Please set the PROJ_DIR variable. "
"For more information see: "
"https://pyproj4.github.io/pyproj/stable/installation.html"
)
Expand Down Expand Up @@ -193,8 +193,7 @@ def get_package_data():

def get_version():
"""
retreive pyproj version information (stored in _proj.pyx) in version variable
(taken from Fiona)
retreive pyproj version information (taken from Fiona)
"""
with open(os.path.join("pyproj", "__init__.py"), "r") as f:
for line in f:
Expand All @@ -204,46 +203,9 @@ def get_version():
raise SystemExit("ERROR: pyproj version not fount.")


def get_long_description():
"""
Get the long description for the file.
"""
with open("README.md", encoding="utf-8") as ld_file:
return ld_file.read()


# static items in setup.cfg
setup(
name="pyproj",
version=get_version(),
description="Python interface to PROJ (cartographic projections "
"and coordinate transformations library)",
long_description=get_long_description(),
long_description_content_type="text/markdown",
url="https://github.com/pyproj4/pyproj",
download_url="http://python.org/pypi/pyproj",
author="Jeff Whitaker",
author_email="jeffrey.s.whitaker@noaa.gov",
platforms=["any"],
license="MIT",
entry_points={"console_scripts": ["pyproj=pyproj.__main__:main"]},
keywords=["python", "map projections", "GIS", "mapping", "maps"],
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Mathematics",
"Operating System :: OS Independent",
"Typing :: Typed",
],
packages=["pyproj", "pyproj.crs"],
python_requires=">=3.6",
ext_modules=get_extension_modules(),
package_data=get_package_data(),
zip_safe=False, # https://mypy.readthedocs.io/en/stable/installed_packages.html
install_requires=["certifi"],
)