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

python3Packages.geopy: 1.20 -> unstable-2019-11-10 #73158

Merged
merged 2 commits into from Nov 14, 2019
Merged

python3Packages.geopy: 1.20 -> unstable-2019-11-10 #73158

merged 2 commits into from Nov 14, 2019

Conversation

GuillaumeDesforges
Copy link
Contributor

@GuillaumeDesforges GuillaumeDesforges commented Nov 10, 2019

Motivation for this change

geopy is not compatible with Python 3, see issue #73155.

Things done

There is now a switch depending on Python version:

If Python is 2.7, keep like before.
If Python is 3.7, fetch package from Github as the 2.0 version is not yet release.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

No maintainer found in package declaration.

@GuillaumeDesforges GuillaumeDesforges changed the title geopy: 1.2.0 -> 2.80 for Python 3 only geopy: 1.2.0 -> 2.0 for Python 3 only Nov 10, 2019
};

doCheck = false; # too much
geopy37 = {
version = "2.0.0";
Copy link
Member

Choose a reason for hiding this comment

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

If they haven't released 2.0.0 you cannot call it that. Please mark it as unstable and add the date as version. See the manual

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't know about the naming convention, sorry.

description = "Python Geocoding Toolbox";
license = licenses.mit;
broken = true;
buildInputs = commonBuildInputs ++ [ geographiclib ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
buildInputs = commonBuildInputs ++ [ geographiclib ];
buildInputs = commonBuildInputs;

Anything in propagatedBuildInputs doesn't need to be added to buildInputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok thanks


buildInputs = [ mock tox pylint ];
src = fetchFromGitHub {
owner = "geopy";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
owner = "geopy";
owner = pname;
repo = pname;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

Please create two separate expressions, one called 2.nix for Python 2 and default.nix for Python 3.

@GuillaumeDesforges
Copy link
Contributor Author

Please create two separate expressions, one called 2.nix for Python 2 and default.nix for Python 3.

What would be the best way to do that ? Do I setup most parameters in default.nix and then override in 2.nix, or do I put conditions in default.nix importing 2.nix ?

@FRidh
Copy link
Member

FRidh commented Nov 11, 2019

Remove the common. Just consider them as if they were two separate packages. Then, in python-packages.nix you import and call them.

Copy link
Member

@JohnAZoidberg JohnAZoidberg left a comment

Choose a reason for hiding this comment

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

Please test the package again after making the changes and report what testing you have done. (The examples in the README seem reasonable)

meta = with stdenv.lib; {
homepage = "https://github.com/geopy/geopy";
description = "Python Geocoding Toolbox";
license = licenses.mit;
Copy link
Member

Choose a reason for hiding this comment

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

Would you like to be the maintainer for this package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this is of any help, sure

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it would be great if somebody updated/changed this package that you could be a second reviewer, who is familiar with this package.

pname = "geopy";
version = "1.20.0";
disabled = !isPy27;
pname = "geopy";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pname = "geopy";
pname = "geopy-unstable";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't understand the first time, thanks

version = "1.20.0";
disabled = !isPy27;
pname = "geopy";
version = "2.0-unstable-2019-11-10";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
version = "2.0-unstable-2019-11-10";
version = "2019-11-10";

sha256 = "9419bc90ee6231590c4ae7acf1cf126cefbd0736942da7a6a1436946e80830e2";
};
disabled = !isPy3k; # only Python 3
doCheck = false; # too many checks
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
doCheck = false; # too many checks
doCheck = false; # Needs network access

I tried to run them because "too many checks" doesn't sound like a good excuse not to run them unless they take a considerable amount of time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough, this is just what the comment from the original derivation sounded like to me, my bad


doCheck = false; # too much
buildInputs = [ mock tox pylint ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
buildInputs = [ mock tox pylint ];

They're only needed for the tests and since we don't run them ...
Please also remove in the derivation arguments and the other version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't I just add them in checkInputs in case doCheck gets changed in the future ?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, you could. But it would likely be out of date then.
It looks out of date even now: https://github.com/geopy/geopy/blob/master/setup.py

So I'd just remove it.
Also do you expect them to remove the dependency on network access? Looks like this package needs network access for everything 😆

@GuillaumeDesforges
Copy link
Contributor Author

Please test the package again after making the changes and report what testing you have done. (The examples in the README seem reasonable)

Before every commit I have checked runing the following:

[nix-shell:~/tmp/nixpkgs]$ python
Python 3.7.5 (default, Oct 14 2019, 23:08:55) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from geopy.geocoders import Nominatim
>>> geolocator = Nominatim(user_agent="specify_your_app_name_here")
>>> location = geolocator.geocode("Paris")
>>> print((location.latitude, location.longitude))
(48.8566101, 2.3514992)

homepage = "https://github.com/geopy/geopy";
description = "Python Geocoding Toolbox";
license = licenses.mit;
maintainers = [ "aceus02@gmail.com" ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
maintainers = [ "aceus02@gmail.com" ];
maintainers = with maintainers; [ GuillaumeDesforges ];

Thanks for volunteering :)
Please create an entry for yourself in https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix


doCheck = false; # too much
buildInputs = [ mock tox pylint ];
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, you could. But it would likely be out of date then.
It looks out of date even now: https://github.com/geopy/geopy/blob/master/setup.py

So I'd just remove it.
Also do you expect them to remove the dependency on network access? Looks like this package needs network access for everything 😆

Copy link
Member

@JohnAZoidberg JohnAZoidberg left a comment

Choose a reason for hiding this comment

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

Looks almost good :)
Please address the comments and change the indentation back to two spaces instead of 4. See the manual.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

do you mind squashing the commits? I would do two, one where you freeze the python2 version, and another where you bump the python3 version, otherwise looks okay...

I would prefer to have some unit tests, generally these don't require network access.

@GuillaumeDesforges
Copy link
Contributor Author

Looks almost good :)
Please address the comments and change the indentation back to two spaces instead of 4. See the manual.

Thanks, this has been done.

do you mind squashing the commits? I would do two, one where you freeze the python2 version, and another where you bump the python3 version, otherwise looks okay...

I would prefer to have some unit tests, generally these don't require network access.

Squashed into two as asked (nice git exercise)

It seems that it would be hard to override pytest to run only the tests that do not require networking.

Guillaume Desforges added 2 commits November 14, 2019 23:18
* Update geopy to unstable version from GitHub for Python 3+
* Add GuillaumeDesforges as maintainer
Copy link
Member

@JohnAZoidberg JohnAZoidberg left a comment

Choose a reason for hiding this comment

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

Thanks a lot Guillaume!
I took the liberty to adjust the commit title slightly (add the pythonXPackages.) and remove two trailing spaces that I didn't spot in GitHub.

I tested it again in Python 2 and 3. Both work fine with the example that you gave. :)

@JohnAZoidberg JohnAZoidberg changed the title geopy: 1.2.0 -> 2.0 for Python 3 only python3Packages.geopy: 1.20 -> unstable-2019-11-10 Nov 14, 2019
@JohnAZoidberg JohnAZoidberg merged commit c4ed79e into NixOS:master Nov 14, 2019
@GuillaumeDesforges
Copy link
Contributor Author

@JohnAZoidberg thank you very much for your insightful reviews, hope I can be of help in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants