jazzband / geojson

Python bindings and utilities for GeoJSON
https://pypi.python.org/pypi/geojson/
BSD 3-Clause "New" or "Revised" License
898 stars 120 forks source link

Add support for Python 3.9 #156

Closed hugovk closed 3 years ago

hugovk commented 3 years ago

Adds testing and the Trove classifier for Python 3.9, which came out last month.

Also upgrades Python syntax with https://github.com/asottile/pyupgrade --py36-plus and removes some redundant Python 2 code.

This also adds:

python_requires=">=3.6, <=3.9",

Which helps pip only install for those versions, so perhaps this could be removed from setup.py?

if not (major_version == 3 and 6 <= minor_version <= 9):
    sys.stderr.write("Sorry, only Python 3.6 - 3.9 are "
                     "supported at this time.\n")
    exit(1)

I'd also suggest removing the upper limit too; when Python 3.10 comes out next October, it'll probably work, and people won't need to wait for a new release of geojson.

codecov[bot] commented 3 years ago

Codecov Report

Merging #156 (e3b02ef) into master (6a29eb3) will increase coverage by 0.95%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #156      +/-   ##
==========================================
+ Coverage   93.90%   94.85%   +0.95%     
==========================================
  Files          10       10              
  Lines         361      350      -11     
  Branches       75       71       -4     
==========================================
- Hits          339      332       -7     
+ Misses         14       11       -3     
+ Partials        8        7       -1     
Impacted Files Coverage Δ
geojson/base.py 94.73% <100.00%> (-0.10%) :arrow_down:
geojson/examples.py 100.00% <100.00%> (ø)
geojson/feature.py 100.00% <100.00%> (ø)
geojson/geometry.py 100.00% <100.00%> (+2.22%) :arrow_up:
geojson/mapping.py 88.88% <100.00%> (+7.93%) :arrow_up:
geojson/utils.py 89.18% <100.00%> (-0.29%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3bc2831...e3b02ef. Read the comment docs.

akadouri commented 3 years ago

Would it be possible to merge these change in and create a release for python 3.9 support? I haven't reviewed code in this package before but these changes look good to me.