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

python2Packages.cfn-lint: fix importlib-resources version bounds #97762

Merged
merged 1 commit into from Sep 13, 2020

Conversation

freezeboy
Copy link
Contributor

@freezeboy freezeboy commented Sep 11, 2020

Motivation for this change

package dependencies don't support python 2
ZHF: #97479

Things done
  • 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 nixpkgs-review --run "nixpkgs-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.

@drewrisinger
Copy link
Contributor

Why is this package being disabled? What's failing? From looking at upstream, it supports py27: https://github.com/aws-cloudformation/cfn-python-lint/blob/027091757862c3d88cb02a264200cfeefdb3a156/setup.py#L59

@freezeboy
Copy link
Contributor Author

importlib-resource is required to be 1.4, and we have 3.0.0 in the repository

@freezeboy freezeboy changed the title cfn-lint: disable python2.7 python2Packages.cfn-lint: remove Sep 11, 2020
@drewrisinger
Copy link
Contributor

Applying this patch seemed to work (tested against GitHub source, not PyPi). Don't need to disable python2.7 then.

  postPatch = ''
    substituteInPlace setup.py --replace 'importlib_resources~=1.4;python_version<"3.7" and python_version!="3.4"' 'importlib_resources;python_version<"3.7"'
  '';

@freezeboy
Copy link
Contributor Author

Thank you for the patch

@freezeboy freezeboy changed the title python2Packages.cfn-lint: remove python2Packages.cfn-lint: fix build Sep 11, 2020
@drewrisinger
Copy link
Contributor

Commit should be renamed to something like pythonPackages.cfn-lint: .... Has a large rebuild via nix-review, so I'm not going to build all locally, but tested working with some packages:

nix-review pr 97762 -p pythonPackages.cfn-lint -p apache-airflow

https://github.com/NixOS/nixpkgs/pull/97762
2 packages built:
apache-airflow python3Packages.cfn-lint

@freezeboy freezeboy changed the title python2Packages.cfn-lint: fix build python2Packages.cfn-lint: fix importlib-resources version bounds Sep 13, 2020
@risicle
Copy link
Contributor

risicle commented Sep 13, 2020

Seeing as we're now patching the source, would you be able to add a pythonImportsCheck = seeing as we don't have tests enabled here? It's better than nothing.

Also, added import checks to have a minimal test for the package
@freezeboy
Copy link
Contributor Author

As it is supposed to be an app more than a library, I only took the packages in the root folder's __init__py file.

Built for python2 and 3 locally

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.

does in fact fix the build, other failures can be dealt with in other PRs

@jonringer jonringer merged commit 037b8ae into NixOS:master Sep 13, 2020
@freezeboy freezeboy deleted the disable-py2-cfn-lint branch September 13, 2020 12:04
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

4 participants