-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
pythonPackages.apache-airflow: init at 1.10.3 #65026
Conversation
99dce52
to
4f587fb
Compare
So... I was able to build on both python2 and python3 and run |
@GrahamcOfBorg build python2Packages.airflow python3Packages.airflow |
The package is exposed as pythonPackages.apache-airflow and apache-airflow. Thoughts? Should it be airflow (this is not the official pypi name) |
@GrahamcOfBorg build python2Packages.apache-airflow python3Packages.apache-airflow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix-review
passes on NixOS
diff LGTM
binary at least displays usage (not familiar enough with application to test further)
would like to see some unit tests ran, just to make sure that dependency import paths don't change from what airflow assumes there to be.
Not related to this pr:
Someone should upstream the dependency bounds of the dependencies, some of the the code bases at work do this much pinning and it makes my soul hurt (I understand the pain of being broken downstream constantly, but some of these are overly restrictive)
substituteInPlace setup.py \
--replace "flask-caching>=1.3.3, <1.4.0" "flask-caching" \
--replace "flask-appbuilder==1.12.3" "flask-appbuilder" \
--replace "pendulum==1.4.4" "pendulum" \
--replace "configparser>=3.5.0, <3.6.0" "configparser" \
--replace "jinja2>=2.7.3, <=2.10.0" "jinja2" \
--replace "funcsigs==1.0.0" "funcsigs" \
--replace "flask-swagger==0.2.13" "flask-swagger" \
--replace "python-daemon>=2.1.1, <2.2" "python-daemon" \
--replace "alembic>=0.9, <1.0" "alembic" \
--replace "markdown>=2.5.2, <3.0" "markdown" \
--replace "future>=0.16.0, <0.17" "future" \
--replace "tenacity==4.12.0" "tenacity" \
--replace "werkzeug>=0.14.1, <0.15.0" "werkzeug"
Result of 35 package were build:
@jonringer I agree it would be nice to get some unit tests working with apache-airflow. That way we have a better guarentee than |
I do not. In all honesty, I prefer not to touch python code. I'm forced to because of work ;( |
# remove mockldap requirement | ||
rm flask_appbuilder/tests/_test_ldapsearch.py | ||
nosetests flask_appbuilder.api flask_appbuilder.tests.test_api | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth leaving these in when they don't actually solve the problem?
35 packages built on macos 10.13, py27 and py37 versions' executables both run. Excellent work here. |
d654f91
to
fd7eef6
Compare
@GrahamcOfBorg build python2Packages.airflow python3Packages.airflow |
Ready for merge. Test pass and builds on osx and linux |
Ping. Ready for merge |
}: | ||
|
||
let # import error "from pendulum import Pendulum" due to 2.x | ||
pendulum1 = pendulum.overrideAttrs (super: rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot have multiple versions in python-packages.nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the restriction that only 1 version is allowed. Should I create a patch that has support for the newer versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, to get this in it needs to support the pendulum version we have in the package set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get around this restriction could I treat airflow as an application rather than a library? I think this could possibly be a hard patch to maintain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And not include it in pythonPackages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Treating airflow itself as an application rather than a library sounds like a good way to go, with all of the dependencies aside from pendulum being regular python packages in the distribution.
I'd really like to be able to use this from NixPkg and appreciate the work the two of you are doing, btw!
@costrouc if it's very unlikely that another package will ever need to import this (E.g. it's an application), then I would package it as just an application, and may move it out of python modules (to discourage trying to import it). But I would still wait for @FRidh to input, as he probably has better insights into the correct actions. |
On a similar note I have a devious plan for "multiple" python versions.
This would allow multiple versions of a packages 😁. i would like to see what would happen with a tool like this. |
I'm assuming it would be a lot of complexity and hair-pulling in constructing a dependency house of cards. However, if successful, i think it would be really convenient to use when there's mutually exclusive version bounds in the same closure. |
Yes I agree that It could add to complexity and would need to be very explicit what is happening. Having something like this would be extremely helpful in these cases were we need to break the rules of multiple packages in nixpkgs. For example here I only want to change the verisons of two packages https://github.com/NixOS/nixpkgs/blob/fd7eef6dcf212e8e164f2201b7e58bb63247f290/pkgs/development/python-modules/apache-airflow/default.nix#L53-L73 |
3046b43
to
1f39697
Compare
Okay so this PR is a working example of rewriting imports with https://github.com/nix-community/nixpkgs-pytools/#python-rewrite-imports. It allows multiple versions of python packages existing within the same PYTHONPATH. How does it work? It uses rope https://github.com/python-rope/rope to refactor certain imports. Rope makes this approach quite robust. Here is an example of how it correctly refactors chaning the numpy import https://github.com/nix-community/nixpkgs-pytools/blob/master/tests/test_import_rewrite.py. I have left the "tricks" done in rewriting the imports as explicit as possible in this PR. In hopes that if others think this is worth moving forward with we can create a wrapper function that will automatically apply these changes in a more user friendly way. This approach should have minimal impact on libraries that depend on it. Personally I think this is a feasable approach to different versions of python package coexisting. Would love to hear others thoughts. In this PR I demonstrate that you can have packages that would normally break airflow in the propagated build inputs ( @FRidh what are your thoughts? Would this be an okay approach to having several versions of a python package available? (Obviously having 1 version is ideal and we should always strive for the latest). |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/scaling-the-python-package-set-in-nixpkgs/3749/18 |
1f39697
to
907fe9c
Compare
@GrahamcOfBorg build python2Packages.apache-airflow python3Packages.apache-airflow |
@FRidh Does the PR still have the controversial multiple versions? Or anything else you want changed? I might take this over so just tell me what to do :) |
#73074 adds apache-airflow-1.10.5 and has been merged, so this can be closed? |
Motivation for this change
Packaging apache airflow. This PR closes this PR #44028
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)