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

python-keystoneclient: Init at 4.1.0 (+ all openstack dependencies) #96624

Closed

Conversation

SCOTT-HAMILTON
Copy link
Contributor

Motivation for this change
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.

@SCOTT-HAMILTON
Copy link
Contributor Author

This probably won't built because of importlib-metadata < 1.7.0, waiting for ofborg to tell me.

Copy link
Contributor

@catern catern left a comment

Choose a reason for hiding this comment

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

My comments on the first module all apply for all the modules.

You should split these modules up into individual commits; and also, don't capitalize "Init".

pkgs/development/python-modules/debtcollector/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/debtcollector/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
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.

One commit per package.

@jonringer
Copy link
Contributor

sorry, I sorted python-packages.nix please reabase on latest master and re-sort the entries please :)

@SCOTT-HAMILTON
Copy link
Contributor Author

Took a bit of time but conflicts have been fixed for each commits.

@SCOTT-HAMILTON
Copy link
Contributor Author

Currently working on configuring the tox test suites. Don't merge this now.

@SCOTT-HAMILTON
Copy link
Contributor Author

SCOTT-HAMILTON commented Sep 2, 2020

And now I've got a problem :
oslo-config test requires olsotest.
oslotest requires stestr.
stestr requires subunit2sql.
subunit2sql requires oslo-config >= 4.0.0

What should I do ?
I could make an oslo-config-no-check, make subunit2sql require it and then the rest would follow up.

@catern
Copy link
Contributor

catern commented Sep 2, 2020

You should file an issue upstream - ideally they can easily break the circular test dependency and make a new fixed release - that's been my experience before.

Pending that, you can just skip tests in oslo-config.

@SCOTT-HAMILTON
Copy link
Contributor Author

Filed an issue https://bugs.launchpad.net/oslo.config/+bug/1893978. I'll remove oslo-config tests for the moment.

@SCOTT-HAMILTON
Copy link
Contributor Author

I've resolved checkInputs for all packages until reaching one of the packages of the circular dependency issue. So for now none of them have doCheck = true for this reason. Merging can be done, I'll PR an update when openstack solves this issue.

sha256 = "0ab8ic9bk644i8134z044kpcf6pvawqf4rq4xgv1p11msbs82ybq";
};

patches = [ ./tox-pass-system-pythonpath.patch ];
Copy link
Contributor

Choose a reason for hiding this comment

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

tox overlaps with nix does, usually I just remove the tox.ini's before testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for that, it makes it really easier !

];

# Circular dependencies on stestr, see https://bugs.launchpad.net/oslo.config/+bug/1893978
doCheck = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

If tests are not available, then please use pythonImportsCheck to import the most important modules. This isn't as good as unit tests, but will usually give a good indication of run-time errors. Please see pythonImportsCheck documentation for more information.

Comment on lines +11 to +21
let
pbr_5_5_0 = pbr.overrideAttrs (old: {
version = "5.5.0";
name = "pbr-5.5.0";
src = fetchPypi {
pname = "pbr";
version = "5.5.0";
sha256 = "1sl2w7zq33kzbh6im3lyl7jfwyddjkqmrx0y5b93v2n7a67xkgql";
};
});
in
Copy link
Contributor

Choose a reason for hiding this comment

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

having different versions of a python module can subtley break other packages at runtime.

This is only allowed with very few exceptions. Please try to remove it (relax version bounds on the package which is doing the pinning"


checkPhase = ''
export UPPER_CONSTRAINTS_FILE="${upper-constraints}"
tox
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove tox, and just do the test suite

'';

# Circular dependencies on oslotest, see https://bugs.launchpad.net/oslo.config/+bug/1893978
doCheck = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

If tests are not available, then please use pythonImportsCheck to import the most important modules. This isn't as good as unit tests, but will usually give a good indication of run-time errors. Please see pythonImportsCheck documentation for more information.

doc8
fixtures
oslo-i18n
tox
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just remove tox, and run the commands it was meant to run

Comment on lines +9 to +19
let
bandit_1_5_1 = bandit.overrideAttrs (old: {
version = "1.5.1";
name = "bandit-1.5.1";
src = fetchPypi {
pname = "bandit";
version = "1.5.1";
sha256 = "0k5sd4xgd6lp2ap1vd8nk5fabcdyw62cf9fmj791n7nyx77zl4wl";
};
});
in
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't be allowed, see above

Comment on lines +10 to +18
let
pyModuleDeps = [
keystoneauth1
oslo-config
oslo-i18n
oslo-serialization
pbr
];
in
Copy link
Contributor

Choose a reason for hiding this comment

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

please just move below

Comment on lines +10 to +18
let
pyModuleDeps = [
keystoneauth1
oslo-config
oslo-i18n
oslo-serialization
pbr
];
in
Copy link
Contributor

Choose a reason for hiding this comment

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

please just put on propagatedBuildInputs

Comment on lines +5641 to +5642
python-keystoneclient = disabledIf (!pythonOlder "3.8") (callPackage ../development/python-modules/python-keystoneclient { });

Copy link
Contributor

Choose a reason for hiding this comment

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

please move into expression:

   disabled = pythonAtLeast "3.8";

@SCOTT-HAMILTON
Copy link
Contributor Author

Currently working on your change requests, removed tox on oslo-config test suite but I now have another circular dependency graph ( a bit simpler this time) :
oslo-config test suite requires oslo-log
oslo-log requires oslo-config.
So I'm just checking import oslo_config for now.

@FRidh
Copy link
Member

FRidh commented Sep 4, 2020

I don't think having these packages in Nixpkgs is a good idea. We've had them in the past, and they were problematic because of incompatible dependencies. As commented by @jonringer, the same applies to this PR.

Check e.g. git log oslo and git log keystoneclient.

@FRidh
Copy link
Member

FRidh commented Sep 20, 2020

Note that if all you need is a cli, and not importable libraries, you could use a tool such as poetry2nix. (Not saying anything about including that in Nixpkgs here though.)

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/pull-request-etiquette-when-submitting-lots-of-packages-at-once/9065/2

@SuperSandro2000
Copy link
Member

@SCOTT-HAMILTON please fix the eval issue.

@SCOTT-HAMILTON
Copy link
Contributor Author

I think that @FRidh is right when he says that keystonclient is better out of nixpkgs. I still didn't get any answer from the ubuntu devs anyway regarding the circular deps. So despite having struggled a bit for this, I think it's better to close this PR.

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

7 participants