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

Update setup.py PROJ version checking #211

Merged
merged 1 commit into from
Mar 20, 2019
Merged

Update setup.py PROJ version checking #211

merged 1 commit into from
Mar 20, 2019

Conversation

micahcochran
Copy link
Collaborator

In check_proj_version() add installed PROJ version to error message, return proj_version, use pkg_resources.parse_version() to provide a more featureful Version object.

After @snowman2 asked about the matter, so I just dug into it. This is the better Version object because distutils LooseVersion and StrictVersion are poorly documented and support the superceeded PEP 386. pkg_resources.parse_version follows PEP 440, and pkg_resources is provided by setuptools.

The returned proj_version value could be useful if there needs to be some other steps that have to be taken for future version of PROJ, while supporting older PROJ versions with operators such as
version >= parse_version('6.1.0').

So on my system it provides this error message

micah@micah-laptop:~/prj3/pyproj$ pip3 install .
Processing /home/micah/prj3/pyproj
    Complete output from command python setup.py egg_info:
    ERROR: Minimum supported proj version is 6.0.0, installed version is 4.9.3.
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-o3a25tgo-build/

… message, return proj_value, use pkg_resources.parse_version() to provide a more featureful Version object
@snowman2
Copy link
Member

This is a nice addition! Side note: I wasn't referring to the setup.py in my previous comment, but this seems to be a beneficial miscommunication. I probably should have communicated that better. Originally thinking about test coverage for checking the pyproj.proj_version_str was set properly.

Copy link
Member

@snowman2 snowman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved from my end.

@snowman2 snowman2 requested a review from jswhit March 20, 2019 11:45
@snowman2 snowman2 merged commit 0ad0ba4 into pyproj4:master Mar 20, 2019
@micahcochran micahcochran deleted the setup-parse-version branch March 20, 2019 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants