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-ulid dependency not found #921

Closed
l0b0 opened this issue Jan 4, 2023 · 1 comment · Fixed by #931
Closed

python-ulid dependency not found #921

l0b0 opened this issue Jan 4, 2023 · 1 comment · Fixed by #931

Comments

@l0b0
Copy link
Contributor

l0b0 commented Jan 4, 2023

Describe the issue

The linz-logger package declares a dependency on python-ulid. This works when installed via poetry install, but fails in poetry2nix:

Processing /build/linz_logger-0.11.0
  Running command Preparing metadata (pyproject.toml)
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: linz-logger
  Running command Building wheel for linz-logger (pyproject.toml)
  Building wheel for linz-logger (pyproject.toml) ... done
  Created wheel for linz-logger: filename=linz_logger-0.11.0-py3-none-any.whl size=4798 sha256=0f35126e1343fa3da2ce1ba5ee804d3589013bd8124a5c7517c0d285a91e5871
  Stored in directory: /build/pip-ephem-wheel-cache-frtj87kr/wheels/6b/2e/dd/570a600966922fadf727178724ab0d1b29fcfb05f27c944af1
Successfully built linz-logger
Finished creating a wheel...
Finished executing pipBuildPhase
@nix { "action": "setPhase", "phase": "installPhase" }
installing
Executing pipInstallPhase
/build/linz_logger-0.11.0/dist /build/linz_logger-0.11.0
Processing ./linz_logger-0.11.0-py3-none-any.whl
Requirement already satisfied: structlog<23.0.0,>=22.1.0 in /nix/store/x8lbzynbn7bsw6n7hlqd25k7hb53qbhc-python3.9-structlog-22.3.0/lib/python3.9/site-packages (from linz-logger==0.11.0) (22>
ERROR: Could not find a version that satisfies the requirement python-ulid<2.0.0,>=1.1.0 (from linz-logger) (from versions: none)
ERROR: No matching distribution found for python-ulid<2.0.0,>=1.1.0

Additional context

Maybe this is caused by the inconsistent package names? The latest release is python-ulid-1.1.0.tar.gz (hyphenated) and python_ulid-1.1.0-py3-none-any.whl (underscored).

  • default.nix/shell.nix/flake.nix
{ pkgs ? import
    (
      fetchTarball (
        builtins.fromJSON (
          builtins.readFile ./nixpkgs.json)))
    { }
}:
let
  poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
    python = pkgs.python39;
    projectDir = builtins.path { path = ./.; name = "test"; };
  };
in
poetryEnv.env
  • pyproject.toml
[tool.poetry]
name = "tmp-ytrtvrh3m6"
version = "0.1.0"
description = ""
authors = ["Victor Engmark <vengmark@linz.govt.nz>"]
readme = "README.md"
packages = [{include = "tmp"}]

[tool.poetry.dependencies]
python = "^3.10"
linz-logger = "^0.11.0"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
  • poetry.lock
# This file is automatically @generated by Poetry and should not be changed by hand.

[[package]]
name = "linz-logger"
version = "0.11.0"
description = "LINZ standard Logging format"
category = "main"
optional = false
python-versions = ">=3.8,<4.0"
files = [
    {file = "linz_logger-0.11.0-py3-none-any.whl", hash = "sha256:1e8ef3f85a77e9506728a022e7b9b6b835c32a7d784ee8d78b6bb28755cc264a"},
    {file = "linz_logger-0.11.0.tar.gz", hash = "sha256:7454e18f613b5aafbb38cad1478d48eab15bacd4d3fe8bb70fcc55f4ea139a6b"},
]

[package.dependencies]
python-ulid = ">=1.1.0,<2.0.0"
structlog = ">=22.1.0,<23.0.0"

[[package]]
name = "python-ulid"
version = "1.1.0"
description = "Universally Unique Lexicographically Sortable Identifier"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
    {file = "python-ulid-1.1.0.tar.gz", hash = "sha256:5fb5e4a91db8ca93e8938a613360b3def299b60d41f847279a8c39c9b2e9c65e"},
    {file = "python_ulid-1.1.0-py3-none-any.whl", hash = "sha256:88c952f6be133dbede19c907d72d26717d2691ec8421512b573144794d891e24"},
]

[[package]]
name = "structlog"
version = "22.3.0"
description = "Structured Logging for Python"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
    {file = "structlog-22.3.0-py3-none-any.whl", hash = "sha256:b403f344f902b220648fa9f286a23c0cc5439a5844d271fec40562dbadbc70ad"},
    {file = "structlog-22.3.0.tar.gz", hash = "sha256:e7509391f215e4afb88b1b80fa3ea074be57a5a17d794bd436a5c949da023333"},
]

[package.extras]
dev = ["structlog[docs,tests,typing]"]
docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-mermaid", "twisted"]
tests = ["coverage[toml]", "freezegun (>=0.2.8)", "pretend", "pytest (>=6.0)", "pytest-asyncio (>=0.17)", "simplejson"]
typing = ["mypy", "rich", "twisted"]

[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "4334a7f1b159cff4e3729e00acccf01f69917413bb64a441c8620d12483108e4"
  • nixpkgs.json
{
  "name": "release-22.11-2023-01-03T21-39-40Z",
  "url": "https://github.com/NixOS/nixpkgs/archive/a9eedea7232f5d00f0aca7267efb69a54da1b8a1.tar.gz",
  "sha256": "05giahp6v6q4smb8b9dbjc1hsfxhla831a152s0rywikdfvsmv1g"
}
@adisbladis
Copy link
Member

Just eyeballing the output this line ERROR: Could not find a version that satisfies the requirement python-ulid<2.0.0,>=1.1.0 (from linz-logger) (from versions: none) hints to me that it's the build time version detection failing.

This is usually because of setuptools-scm. I'd try adding an override for python-ulid.
It might be sufficient to simply add setuptools-scm.

l0b0 added a commit to l0b0/poetry2nix that referenced this issue Jan 8, 2023
l0b0 added a commit to l0b0/poetry2nix that referenced this issue Jan 8, 2023
l0b0 added a commit to l0b0/poetry2nix that referenced this issue Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants