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

python311Packages.ngs-tools, python312Packages.ngs-tools: init at 1.8.5 #344240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

youhaveme9
Copy link
Member

Description of changes

Reusable tools for working with next-generation sequencing (NGS) data

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

homepage = "https://github.com/Lioscro/ngs-tools";
description = "Reusable tools for working with next-generation sequencing (NGS) data";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ youhaveme9 ];
Copy link
Member

Choose a reason for hiding this comment

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

If you have not yet added your name to maintainers/maintainer-list.nix, please do so in another commit of this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @natsukium
Already created a PR regarding this
#343954

buildPythonPackage rec {
pname = "ngs-tools";
version = "1.8.5";
format = "setuptools";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
format = "setuptools";
pyproject = true;

Please add pyproject = true; and build-system = [ setuptools ]; to avoid the legacy setuptools build.

Note that the pyproject format falls back to using setuptools, so you can use pyproject = true even if the package only has a setup.py. When set to false, you can use the existing hooks or provide your own logic to build the package. This can be useful for packages that don't support the pyproject format. When unset, the legacy setuptools hooks are used for backwards compatibility.

https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md#buildpythonpackage-parameters-buildpythonpackage-parameters


src = fetchPypi {
inherit pname version;
sha256 = "OA4jahAcWxrDwPzbzJCKIQF5tu8qk/vqn06w7C7cHeA=";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sha256 = "OA4jahAcWxrDwPzbzJCKIQF5tu8qk/vqn06w7C7cHeA=";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";

Please use SRI hash instead.

sha256 = "OA4jahAcWxrDwPzbzJCKIQF5tu8qk/vqn06w7C7cHeA=";
};

propagatedBuildInputs = [
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
propagatedBuildInputs = [
dependencies = [

typing-extensions
];

nativeBuildInputs = [ setuptools-scm ];
Copy link
Member

Choose a reason for hiding this comment

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

setuptools-scm should go to build-system.


nativeBuildInputs = [ setuptools-scm ];
pythonImportsCheck = [ "ngs_tools" ];

Copy link
Member

Choose a reason for hiding this comment

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

Could you enable tests with pytestCheckHook or similar?

Make sure the tests are enabled using for example pytestCheckHook and, in the case of libraries, are passing for all interpreters. If certain tests fail they can be disabled individually. Try to avoid disabling the tests altogether. In any case, when you disable tests, leave a comment explaining why.

https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md#contributing-guidelines-contributing-guidelines

Copy link
Member Author

@youhaveme9 youhaveme9 Sep 25, 2024

Choose a reason for hiding this comment

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

Enabled test using pytestCheckHook
But getting import errors

==================================== ERRORS ====================================
______________________ ERROR collecting tests/test_bam.py ______________________
ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_bam.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_bam.py:7: in <module>
    from tests.mixins import TestMixin, tqdm_mock
E   ModuleNotFoundError: No module named 'tests'
____________________ ERROR collecting tests/test_binary.py _____________________
ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_binary.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_binary.py:6: in <module>
    from . import mixins
E   ImportError: attempted relative import with no known parent package
___________________ ERROR collecting tests/test_chemistry.py ___________________
ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_chemistry.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_chemistry.py:4: in <module>
    from tests.mixins import TestMixin
E   ModuleNotFoundError: No module named 'tests'
_____________________ ERROR collecting tests/test_fasta.py _____________________
ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_fasta.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_fasta.py:6: in <module>
    from . import mixins
E   ImportError: attempted relative import with no known parent package
_____________________ ERROR collecting tests/test_fastq.py _____________________
ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_fastq.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_fastq.py:8: in <module>
    from . import mixins
E   ImportError: attempted relative import with no known parent package
______________________ ERROR collecting tests/test_gtf.py ______________________
ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_gtf.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_gtf.py:6: in <module>
    from . import mixins
E   ImportError: attempted relative import with no known parent package
___________________ ERROR collecting tests/test_sequence.py ____________________
ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_sequence.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_sequence.py:8: in <module>
    from . import mixins
E   ImportError: attempted relative import with no known parent package
_____________________ ERROR collecting tests/test_utils.py _____________________
ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_utils.py:11: in <module>
    from . import mixins
E   ImportError: attempted relative import with no known parent package
=========================== short test summary info ============================
ERROR tests/test_bam.py
ERROR tests/test_binary.py
ERROR tests/test_chemistry.py
ERROR tests/test_fasta.py
ERROR tests/test_fastq.py
ERROR tests/test_gtf.py
ERROR tests/test_sequence.py
ERROR tests/test_utils.py
!!!!!!!!!!!!!!!!!!! Interrupted: 8 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 8 errors in 0.63s ===============================
error: builder for '/nix/store/ly95bm3jqb625s9qqczr8zc58qdwpvqi-python3.12-ngs-tools-1.8.5.drv' failed with exit code 2;
       last 25 log lines:
       > /nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
       >     return _bootstrap._gcd_import(name[level:], package, level)
       > tests/test_sequence.py:8: in <module>
       >     from . import mixins
       > E   ImportError: attempted relative import with no known parent package
       > _____________________ ERROR collecting tests/test_utils.py _____________________
       > ImportError while importing test module '/private/tmp/nix-build-python3.12-ngs-tools-1.8.5.drv-0/ngs-tools-1.8.5/tests/test_utils.py'.
       > Hint: make sure your test modules/packages have valid Python names.
       > Traceback:
       > /nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/lib/python3.12/importlib/__init__.py:90: in import_module
       >     return _bootstrap._gcd_import(name[level:], package, level)
       > tests/test_utils.py:11: in <module>
       >     from . import mixins
       > E   ImportError: attempted relative import with no known parent package
       > =========================== short test summary info ============================
       > ERROR tests/test_bam.py
       > ERROR tests/test_binary.py
       > ERROR tests/test_chemistry.py
       > ERROR tests/test_fasta.py
       > ERROR tests/test_fastq.py
       > ERROR tests/test_gtf.py
       > ERROR tests/test_sequence.py
       > ERROR tests/test_utils.py
       > !!!!!!!!!!!!!!!!!!! Interrupted: 8 errors during collection !!!!!!!!!!!!!!!!!!!!
       > ============================== 8 errors in 0.63s ===============================
       For full logs, run 'nix-store -l /nix/store/ly95bm3jqb625s9qqczr8zc58qdwpvqi-python3.12-ngs-tools-1.8.5.drv'.

While running pytest in the ngs-tools, passes all the test
I tried using pytest manually

nativeCheckInputs = [ pytest ];
  postInstall = ''
    pytest
  '';

But still getting the same error
Can you please tell me what am I missing here?

@FliegendeWurst FliegendeWurst added the 2.status: needs-changes This PR needs changes by the author label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: needs-changes This PR needs changes by the author 6.topic: python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants