-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Widen importlib-* backport deps, add python_version limits. #12703
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
Conversation
ashb
left a comment
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.
I think there's a use of importlib_resources that should be correct too.
setup.cfg
Outdated
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.
Do we not need to up the min requirements for argcomplete too?
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.
Not really. argcomplete~=1.10 is the same thing as argcomplete>=1.10,<2, and so 1.22 is included in that range.
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.
Put differently: that'd be a separate task if someone wanted to update this explicitly. But unless you depend on the bugfixes in later releases, I'd leave this be. No need to make the dependency link tighter.
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.
Historical we've updated the intermediary rep, otherwise I thought:
Pip would leave argparse at 1.10, which has a dep of importlib_metadata, but then this new dep would install a newer importlib_metadata, leading to incompatible version errors.
Particularly for "older" pips. Am I misremembering?
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.
When you use pip install -U Apache-airflow to upgrade airflow, a newer argcomplete would be installed, automatically.
In my experience it takes installing additional packages with incompatible dependencies for things to break; newer pip versions warn when this happens however. Running pip check lets you list the problem packages.
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.
Confirmed: @mjpieters @ashb
importlib_resources~=1.4 is a requirement of cnf-lint which is requirement of moto 1.3.16 which we have. So anything above 1 will cause version conflict. mot 1.3.16 is the latest available version, so I do not think we can do anything about it.
moto==1.3.16
- aws-xray-sdk [required: >=0.93,!=0.96, installed: 2.6.0]
- botocore [required: >=1.11.3, installed: 1.18.18]
- jmespath [required: >=0.7.1,<1.0.0, installed: 0.10.0]
- python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.1]
- six [required: >=1.5, installed: 1.15.0]
- urllib3 [required: >=1.20,<1.26, installed: 1.25.11]
- future [required: Any, installed: 0.18.2]
- jsonpickle [required: Any, installed: 1.4.1]
- importlib-metadata [required: Any, installed: 1.7.0]
- zipp [required: >=0.5, installed: 3.4.0]
- wrapt [required: Any, installed: 1.12.1]
- boto [required: >=2.36.0, installed: 2.49.0]
- boto3 [required: >=1.9.201, installed: 1.15.18]
- botocore [required: >=1.18.18,<1.19.0, installed: 1.18.18]
- jmespath [required: >=0.7.1,<1.0.0, installed: 0.10.0]
- python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.1]
- six [required: >=1.5, installed: 1.15.0]
- urllib3 [required: >=1.20,<1.26, installed: 1.25.11]
- jmespath [required: >=0.7.1,<1.0.0, installed: 0.10.0]
- s3transfer [required: >=0.3.0,<0.4.0, installed: 0.3.3]
- botocore [required: >=1.12.36,<2.0a.0, installed: 1.18.18]
- jmespath [required: >=0.7.1,<1.0.0, installed: 0.10.0]
- python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.1]
- six [required: >=1.5, installed: 1.15.0]
- urllib3 [required: >=1.20,<1.26, installed: 1.25.11]
- botocore [required: >=1.12.201, installed: 1.18.18]
- jmespath [required: >=0.7.1,<1.0.0, installed: 0.10.0]
- python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.1]
- six [required: >=1.5, installed: 1.15.0]
- urllib3 [required: >=1.20,<1.26, installed: 1.25.11]
- cfn-lint [required: >=0.4.0, installed: 0.42.0]
- aws-sam-translator [required: >=1.25.0, installed: 1.31.0]
- boto3 [required: ~=1.5, installed: 1.15.18]
- botocore [required: >=1.18.18,<1.19.0, installed: 1.18.18]
- jmespath [required: >=0.7.1,<1.0.0, installed: 0.10.0]
- python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.1]
- six [required: >=1.5, installed: 1.15.0]
- urllib3 [required: >=1.20,<1.26, installed: 1.25.11]
- jmespath [required: >=0.7.1,<1.0.0, installed: 0.10.0]
- s3transfer [required: >=0.3.0,<0.4.0, installed: 0.3.3]
- botocore [required: >=1.12.36,<2.0a.0, installed: 1.18.18]
- jmespath [required: >=0.7.1,<1.0.0, installed: 0.10.0]
- python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.1]
- six [required: >=1.5, installed: 1.15.0]
- urllib3 [required: >=1.20,<1.26, installed: 1.25.11]
- jsonschema [required: ~=3.2, installed: 3.2.0]
- attrs [required: >=17.4.0, installed: 20.3.0]
- importlib-metadata [required: Any, installed: 1.7.0]
- zipp [required: >=0.5, installed: 3.4.0]
- pyrsistent [required: >=0.14.0, installed: 0.17.3]
- setuptools [required: Any, installed: 50.3.2]
- six [required: >=1.11.0, installed: 1.15.0]
- six [required: ~=1.15, installed: 1.15.0]
- importlib-resources [required: ~=1.4, installed: 1.5.0]
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.
Yet again pip's lack of a fully featured dependency solver bites us
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.
In order to test it out, I've added the labels "upgrade to latest dependencies" and "full tests needed". Can you please @mjpieters amend and push --force-with-lease to test my theory?
I rebased and pushed before I noticed that a bot had removed the tags again.
I've pushed a change now that ensures we only allow importlib-resources 1.x (starting with 1.4)
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.
yeah - full tests needed only works after the approval status is "Green" (whch is actually good - we can see if it wiorks for 3.6 first and once it does, we approve and the label will be added and we rerun it again with full matrix of tests.
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.
Let's see if it works. I will approve it tentatively, and please rebase @mjpieters - let's see if it will work.
The single import I found is already guarded. Or were you thinking of something else? |
setup.cfg
Outdated
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.
The problem might be that in our process (in master merges) we automatically do 'pip install .[all] --upgrade --upgrade-strategy eager` to automatically find set of latest constraints that are matching setup.py + setup.cfg limitations, Then we run pip check and then we run all tests and if it all passes we automatically commit the new constraints.
As far as I remember without ~1.* for importlib_resources in install_requires caused a problem as pip first tries to install the highest version matching in install_requires only - without looking at extras. Once it installs this version, it will only then try to do eager update on all other extras and one of our dependencies already has importib_resources ~= 1.4. Eager upgrade will never downgrade the packages installed by install_requires, so this results in version conflict.
Oh no that was it. Thought it wasn't guarded for some reason |
|
Opened aws-cloudformation/cfn-lint#1808 -- not sure how quickly that will get merged and released. |
74777f0 to
c9d3167
Compare
|
|
potiuk
left a comment
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.
Approved to get the label working. But let's not merge it until IP check succeeds for all python versions.
|
Can you please rebase @jpieters ? |
e22448f to
fb94f39
Compare
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
@potiuk I don't know if the Google provider package import failure is related? Would that be caused by an ancient version having been pulled in? |
|
Nope, it's that Google updated that package and moved the class, see googleapis/python-pubsub@6b9eec8 |
I think we had <2.0.0 limit on all Google Python libraries. They released all libs in their 2.0 version - those are not backwards-compatibe and we have (or I thought so) limited those libs to <2.0 for all google lib (until we rewrite the operators) |
'google-cloud-pubsub>=1.0.0,<2.0.0', |
|
I just downloaded the image built for your PR and inspecting it: The good thing is that we are storing all the images from cI in the registry and we can always reproduce things locally:
|
|
pip freeze |grep pubsub |
|
That works:
|
|
Same here:
|
|
Interesting thing that in the same image all those work too:
|
|
OK. I reproduced it : docker run -it --entrypoint /usr/local/bin/dumb-init docker.pkg.github.com/apache/airflow/master-python3.6-ci:392290560 -- /opt/airflow/scripts/in_container/run_prepare_provider_readme.sh |
|
The problem is this line: "Installing remaining packages from 'all' extras" We are running all remaining packages from "devel_all" extras: Including Apache-Beam is the only excluded package for CI image as it used to be known by really bad requirements, forcing many packages to downgrade. We are however installing it for provider package check to be able to import DataProc. I was actually going to take a look at apache-beam for 2.0 now. I discussed it today with @mik-laj that the recent 'apache-beam' has better requirements and we should be able to install it without breaking too much - obviously not that version. |
|
I will take a look at not excluding apache-beam tomorrow. |
|
Also what might help is this PR which I have to finish: #12693 We are not using constraints in this install, which is the reason why so many packages got downgraded. I will see to it tomorrow. Stay tuned. |
|
BTW. It is super easy to reproduce it all thanks to the image storage in registry. This is exactly why I implemented this: #12718 - it will tell you exactly what command you should run to be dropped to the same image that is used in CI and you can run exactly what was run in CI and get perfect reproduction capabilities (I did it now and once we merge this PR, you will get those instructions how to get there: |
Previously the output of instaling remaining packges when testing provider imports was only shown on error. However it is useful to know what's going on even if it clutters the log. Note that this installation is only needed until we include apache-beam in the installed packages on CI. Related to apache#12703 This PR shows the output always .
|
Added #12703 to show output of this "devel_all" installation in logs also on success (previously it was only shown on failure) |
) Previously the output of instaling remaining packges when testing provider imports was only shown on error. However it is useful to know what's going on even if it clutters the log. Note that this installation is only needed until we include apache-beam in the installed packages on CI. Related to #12703 This PR shows the output always .
|
The change to cfn-lint has merged, from previous history it looks like they release every week or two. |
Later versions either add small features not used in Airflow, packaging updates and bug fixes or perf improvements. Moreover, newer Python releases already include the functionality needed.
No point in keeping this here, as it is already part of the main dependencies.
There are provider dependencies that can't use anything newer, and pip is not sophisticated enough to downgrade packages based on new information.
fb94f39 to
9546bab
Compare
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
The Workflow run is cancelling this PR. Building image for the PR has been cancelled |
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
Later versions either add small features not used in Airflow, packaging updates and bug fixes or perf improvements. Moreover, newer Python releases already include the functionality needed.
It's generally a better idea to be permissive in dependency versions to prevent
accidentally limiting what other packages can be used with Airflow.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.