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.pythonix: 0.1.6 -> 0.1.7, fix python module #108259

Merged
merged 1 commit into from Jan 6, 2021

Conversation

r-burns
Copy link
Contributor

@r-burns r-burns commented Jan 2, 2021

Pythonix uses the same python as meson, so we need to override
meson to use the right python version or the module won't import.

Also added a pythonImportsCheck to prevent regressions.

Corresponding upstream fix: Mic92/pythonix@ee22a8f

Motivation for this change

#103151 (comment)

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.

@r-burns
Copy link
Contributor Author

r-burns commented Jan 2, 2021

Result of nixpkgs-review 1

6 packages built:
  • python37Packages.nixpkgs
  • python37Packages.pythonix
  • python38Packages.nixpkgs
  • python38Packages.pythonix
  • python39Packages.nixpkgs
  • python39Packages.pythonix

@@ -18,6 +18,13 @@ buildPythonPackage rec {

buildInputs = [ nix boost ];

postInstall = ''
# XXX why does pythonImportsCheck not set this?
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
Copy link
Member

Choose a reason for hiding this comment

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

@FRidh @jonringer Why is this line necessary? This build install a python modules with meson. Is there something else necessary. The python module is a shared-library only, no python source code.

Copy link
Contributor Author

@r-burns r-burns Jan 3, 2021

Choose a reason for hiding this comment

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

Ah, I think I figured it out. The pythonpath is typically set by the pipInstallHook or eggInstallHook. So when we use e.g. a cmake or meson install the pythonpath isn't updated. I like your approach much better, so I just updated the comment

Copy link
Member

Choose a reason for hiding this comment

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

May want to create a pyproject.toml for the project that uses mesonpep517 as build backend. Then the backend will use meson to build a wheel and we install the wheel using pip.
https://github.com/FRidh/mesonpep517examples

Copy link
Member

Choose a reason for hiding this comment

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

I need to wait for upstream to fix this bug so: https://gitlab.com/thiblahute/mesonpep517/-/issues/5

Pythonix uses the same python as meson, so we need to override
meson to use the right python version or the module won't import.

Also added a pythonImportsCheck to prevent regressions.

Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108259 run on x86_64-darwin 1

6 packages built:
  • python37Packages.nixpkgs
  • python37Packages.pythonix
  • python38Packages.nixpkgs
  • python38Packages.pythonix
  • python39Packages.nixpkgs
  • python39Packages.pythonix

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:

python37Packages.nixpkgs:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;'and apythonImportsCheck`.
python38Packages.nixpkgs:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;'and apythonImportsCheck`.
python39Packages.nixpkgs:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;'and apythonImportsCheck`.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108259 run on x86_64-linux 1

6 packages built:
  • python37Packages.nixpkgs
  • python37Packages.pythonix
  • python38Packages.nixpkgs
  • python38Packages.pythonix
  • python39Packages.nixpkgs
  • python39Packages.pythonix

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:

python37Packages.nixpkgs:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;'and apythonImportsCheck`.
python38Packages.nixpkgs:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;'and apythonImportsCheck`.
python39Packages.nixpkgs:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;'and apythonImportsCheck`.

@Mic92 Mic92 merged commit ce28a48 into NixOS:master Jan 6, 2021
@r-burns r-burns deleted the pythonix branch January 6, 2021 10:37
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