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

python312Packages.papis: 0.13 -> 0.14 #354823

Merged
merged 3 commits into from
Nov 25, 2024
Merged

Conversation

octvs
Copy link
Member

@octvs octvs commented Nov 9, 2024

Papis had a recent minor release, the relevant parts of the 0.14 release
note
are

  • Minimum required Python version bumped to 3.8
    (#552).
  • Moved to pyproject.toml and removed setup.py completely. We use
    hatchling as the build
    backend.
  • Removed arxiv2bib in
    favor of arxiv.py.
  • Removed tqdm dependency (using a progress
    bar from prompt_toolkit instead).
  • Added platformdirs
    dependency for platform-specific config locations.

I've added dependencies arxiv.py and sphinx-click which are mostly taken
from the upstream flake.

Initially I tried having fetchFromGithub on sphinx-click so in essence
having

diff --git a/pkgs/development/python-modules/sphinx-click/default.nix b/pkgs/development/python-modules/sphinx-click/default.nix
index 587618b5fcb5..6f02207abcf8 100644
--- a/pkgs/development/python-modules/sphinx-click/default.nix
+++ b/pkgs/development/python-modules/sphinx-click/default.nix
@@ -1,16 +1,18 @@
 {
   lib,
   buildPythonPackage,
-  fetchPypi,
+  fetchFromGithub,
   pbr,
 }:
 buildPythonPackage rec {
   pname = "sphinx-click";
   version = "5.1.0";
 
-  src = fetchPypi {
-    inherit pname version;
-    hash = "sha256-aBLC22LT+ucaSt2+WooKFsl+tJHzzWP+NLTtfgcjbzM=";
+  src = fetchFromGitHub {
+    owner = "click-contrib";
+    repo = pname;
+    rev = version;
+    hash = "sha256-XDzJjxzHGnMWS/C60hQvfQCX7veMcXklpUjqDcJetM0=";
   };
 
   propagatedBuildInputs = [ pbr ];

However this fails with

Error parsing
Traceback (most recent call last):
  File "/nix/store/5kg9855711f90m0vczaxdjgd5spzgjy9-python3.12-pbr-6.1.0/lib/python3.12/site-packages/pbr/core.py", line 105, in pbr
    attrs = util.cfg_to_args(path, dist.script_args)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5kg9855711f90m0vczaxdjgd5spzgjy9-python3.12-pbr-6.1.0/lib/python3.12/site-packages/pbr/util.py", line 272, in cfg_to_args
    pbr.hooks.setup_hook(config)
  File "/nix/store/5kg9855711f90m0vczaxdjgd5spzgjy9-python3.12-pbr-6.1.0/lib/python3.12/site-packages/pbr/hooks/__init__.py", line 25, in setup_hook
    metadata_config.run()
  File "/nix/store/5kg9855711f90m0vczaxdjgd5spzgjy9-python3.12-pbr-6.1.0/lib/python3.12/site-packages/pbr/hooks/base.py", line 27, in run
    self.hook()
  File "/nix/store/5kg9855711f90m0vczaxdjgd5spzgjy9-python3.12-pbr-6.1.0/lib/python3.12/site-packages/pbr/hooks/metadata.py", line 25, in hook
    self.config['version'] = packaging.get_version(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5kg9855711f90m0vczaxdjgd5spzgjy9-python3.12-pbr-6.1.0/lib/python3.12/site-packages/pbr/packaging.py", line 866, in get_version
    raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name sphinx-click was given, but was not able to be found.
error in setup command: Error parsing /build/source/setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name sphinx-click was given, but was not able to be found.

As far as I can find over
the internet
pbr tries to figure out the version, probably in nix environment it fails to
do so.

Asking this around on matrix room, I was advised to stick by fetchPypi.

Note: First time contributor, comments & feedback highly welcome!

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.

@github-actions github-actions bot added 6.topic: python 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Nov 9, 2024
@nix-owners nix-owners bot requested a review from natsukium November 9, 2024 18:19
@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Nov 9, 2024
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Nov 10, 2024
@ofborg ofborg bot requested review from nico202 and teto November 10, 2024 02:14
@octvs octvs force-pushed the updatePapis branch 2 times, most recently from 0e64844 to d3c173b Compare November 13, 2024 16:17
@octvs
Copy link
Member Author

octvs commented Nov 13, 2024 via email

@steeleduncan
Copy link
Contributor

steeleduncan commented Nov 13, 2024

Unfortunately there is none [1]. [1]: https://github.com/lukasschwab/arxiv.py/branches/all

Understood, but if one were to be added in the future it would not be clear what rev would refer to. The derivation could break in the admittedly unlikely case that the branch and the tag were not on the same commit.

Specifying refs/tags/... is more precise, and leaves the derivation safe against such a change

@octvs
Copy link
Member Author

octvs commented Nov 13, 2024 via email

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 14, 2024
@octvs octvs force-pushed the updatePapis branch 2 times, most recently from 144bc1a to a04feec Compare November 15, 2024 18:56
@octvs
Copy link
Member Author

octvs commented Nov 15, 2024

Since sphinx-click was added via 57e033c, I dropped commit adding it. Also
inspired by it I enabled tests on arxiv package.

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 16, 2024
pkgs/development/python-modules/arxiv/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/arxiv/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/arxiv/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/arxiv/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/papis/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/papis/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/papis/default.nix Outdated Show resolved Hide resolved
Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

mis-approved previously.

@octvs
Copy link
Member Author

octvs commented Nov 16, 2024 via email

@GaetanLepage
Copy link
Contributor

As far as I understand from arxiv repo, they use setup.py, there is no pyproject.toml present, should it be still set to true?

Yes, it should work nonetheless. (Although quite counter intuitive).

I couldn't find explanation of the behaviour of pythonOlder either through google or greping through nixpkgs. Therefore wasn't sure if it is <= or <.

pythonOlder litterally means "if older", so <. "3.11" is not older than "3.11", itself.

Just to learn it fully: is there a reason to avoid using pname variable there?

Yes, it could lead to a broken build if the name of the package is changed. It does not occur often, but this is considered as best practice.

Also, it is better to reply to the change requests directly in their individual message thread.

@octvs
Copy link
Member Author

octvs commented Nov 16, 2024 via email

@octvs
Copy link
Member Author

octvs commented Nov 21, 2024 via email

@GaetanLepage
Copy link
Contributor

Should I disable these tests on arxiv.py derivation or somehow disable sandbox on build?

You can first try adding __darwinAllowLocalNetworking = true;. If it is not enough, then you can just add those tests to disabledTests.

@octvs
Copy link
Member Author

octvs commented Nov 22, 2024 via email

@GaetanLepage GaetanLepage force-pushed the updatePapis branch 2 times, most recently from fa2e3e5 to 6f5cdeb Compare November 22, 2024 07:52
Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

LGTM

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 354823


x86_64-linux

✅ 8 packages built:
  • papis (python312Packages.papis)
  • papis.dist (python312Packages.papis.dist)
  • python311Packages.arxiv
  • python311Packages.arxiv.dist
  • python311Packages.papis
  • python311Packages.papis.dist
  • python312Packages.arxiv
  • python312Packages.arxiv.dist

aarch64-linux

✅ 8 packages built:
  • papis (python312Packages.papis)
  • papis.dist (python312Packages.papis.dist)
  • python311Packages.arxiv
  • python311Packages.arxiv.dist
  • python311Packages.papis
  • python311Packages.papis.dist
  • python312Packages.arxiv
  • python312Packages.arxiv.dist

x86_64-darwin

✅ 8 packages built:
  • papis (python312Packages.papis)
  • papis.dist (python312Packages.papis.dist)
  • python311Packages.arxiv
  • python311Packages.arxiv.dist
  • python311Packages.papis
  • python311Packages.papis.dist
  • python312Packages.arxiv
  • python312Packages.arxiv.dist

aarch64-darwin

✅ 8 packages built:
  • papis (python312Packages.papis)
  • papis.dist (python312Packages.papis.dist)
  • python311Packages.arxiv
  • python311Packages.arxiv.dist
  • python311Packages.papis
  • python311Packages.papis.dist
  • python312Packages.arxiv
  • python312Packages.arxiv.dist

@octvs
Copy link
Member Author

octvs commented Nov 23, 2024 via email

@GaetanLepage
Copy link
Contributor

Just done, thanks for the input.

@octvs I had force-pushed some (mostly cosmetic) changes to your branch. In your last-push you got rid of those changes.
Do you mind if I add them back ?

@natsukium natsukium changed the title pythonPackages.papis: 0.13 -> 0.14 python312Packages.papis: 0.13 -> 0.14 Nov 24, 2024
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 24, 2024
@octvs
Copy link
Member Author

octvs commented Nov 24, 2024 via email

@GaetanLepage
Copy link
Contributor

Let me know if you want me to push them.

Ok no worry, I have just done it.

By the way, the code snippets in your messages don't show correctly:
image

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 354823


x86_64-linux

✅ 8 packages built:
  • papis (python312Packages.papis)
  • papis.dist (python312Packages.papis.dist)
  • python311Packages.arxiv
  • python311Packages.arxiv.dist
  • python311Packages.papis
  • python311Packages.papis.dist
  • python312Packages.arxiv
  • python312Packages.arxiv.dist

aarch64-linux

✅ 8 packages built:
  • papis (python312Packages.papis)
  • papis.dist (python312Packages.papis.dist)
  • python311Packages.arxiv
  • python311Packages.arxiv.dist
  • python311Packages.papis
  • python311Packages.papis.dist
  • python312Packages.arxiv
  • python312Packages.arxiv.dist

x86_64-darwin

✅ 8 packages built:
  • papis (python312Packages.papis)
  • papis.dist (python312Packages.papis.dist)
  • python311Packages.arxiv
  • python311Packages.arxiv.dist
  • python311Packages.papis
  • python311Packages.papis.dist
  • python312Packages.arxiv
  • python312Packages.arxiv.dist

aarch64-darwin

✅ 8 packages built:
  • papis (python312Packages.papis)
  • papis.dist (python312Packages.papis.dist)
  • python311Packages.arxiv
  • python311Packages.arxiv.dist
  • python311Packages.papis
  • python311Packages.papis.dist
  • python312Packages.arxiv
  • python312Packages.arxiv.dist

@GaetanLepage
Copy link
Contributor

Hmm, looks like I am not able to force-push anymore... (permission denied)

@GaetanLepage GaetanLepage merged commit 6cd7910 into NixOS:master Nov 25, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants