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

Incorrect parsing of versions from dependencies if e.g. extras are stated to be installed #48

Open
apirogov opened this issue Sep 26, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@apirogov
Copy link

The fix in #42 apparently did not work, the problem still persists with codemetapy 2.5.1:

[tool.poetry]
name = "somesy"
version = "0.1.0"
description = "A CLI tool for synchronizing software project metadata."
authors = ["Mustafa Soylu <[email protected]>", "Anton Pirogov <[email protected]>"]
maintainers = ["Mustafa Soylu <[email protected]>"]
license = "MIT"

include = [
  "*.md", "LICENSE", "LICENSES", ".reuse/dep5", "CITATION.cff", "codemeta.json",
  { path = "mkdocs.yml", format = "sdist" },
  { path = "docs", format = "sdist" },
  { path = "tests", format = "sdist" },
]

[tool.poetry.dependencies]
python = "^3.8"
pydantic = {extras = ["email"], version = "^1.9.2"}
typer = {extras = ["all"], version = "^0.7.0"}

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
mkdocstrings = {extras = ["python"], version = "^0.21.2"}
markdown-exec = {extras = ["ansi"], version = "^1.6.0"}

Output:

Passed 1 files/sources but specified 0 input types! Automatically guessing types...
Detected input types: [('pyproject.toml', 'python')]
Note: You did not specify a --baseuri so we will not provide identifiers (IRIs) for your SoftwareSourceCode resources (and others)
Initial URI automatically generated, may be overriden later: file:///pyproject-toml
Processing source #1 of 1
Obtaining python package metadata for: pyproject.toml
Loading metadata from pyproject.toml via pyproject-parser
WARNING: No translation for distutils or pyproject.toml key include
Found dependency python ^3.8
Found dependency pydantic {'extras': ['email'
Found dependency 'version': '^1.9.2'}
Found dependency typer {'extras': ['all'
Found dependency 'version': '^0.7.0'}
WARNING: No translation for distutils or pyproject.toml key group
[CODEMETA COMPOSITION (somesy)] processed 50 new triples, total is now 51
[CODEMETA VALIDATION (somesy)] codeRepository not set
[CODEMETA VALIDATION (somesy)] done
{
    "@context": [
        "https://doi.org/10.5063/schema/codemeta-2.0",
        "https://w3id.org/software-iodata",
        "https://raw.githubusercontent.com/jantman/repostatus.org/master/badges/latest/ontology.jsonld",
        "https://schema.org",
        "https://w3id.org/software-types"
    ],
    "@type": "SoftwareSourceCode",
    "author": [
        {
            "@type": "Person",
            "email": "[email protected]",
            "familyName": "Pirogov",
            "givenName": "Anton"
        },
        {
            "@type": "Person",
            "email": "[email protected]",
            "familyName": "Soylu",
            "givenName": "Mustafa"
        }
    ],
    "description": "A CLI tool for synchronizing software project metadata.",
    "identifier": "somesy",
    "license": "http://spdx.org/licenses/MIT",
    "maintainer": {
        "@type": "Person",
        "email": "[email protected]",
        "familyName": "Soylu",
        "givenName": "Mustafa"
    },
    "name": "somesy",
    "runtimePlatform": "Python 3",
    "softwareRequirements": [
        {
            "@type": "SoftwareApplication",
            "identifier": "'version':",
            "name": "'version':",
            "runtimePlatform": "Python 3",
            "version": "'^1.9.2'}"
        },
        {
            "@type": "SoftwareApplication",
            "identifier": "'version':",
            "name": "'version':",
            "runtimePlatform": "Python 3",
            "version": "'^0.7.0'}"
        },
        {
            "@type": "SoftwareApplication",
            "identifier": "pydantic",
            "name": "pydantic",
            "runtimePlatform": "Python 3",
            "version": "{'extras': ['email'"
        },
        {
            "@type": "SoftwareApplication",
            "identifier": "python",
            "name": "python",
            "runtimePlatform": "Python 3",
            "version": "^3.8"
        },
        {
            "@type": "SoftwareApplication",
            "identifier": "typer",
            "name": "typer",
            "runtimePlatform": "Python 3",
            "version": "{'extras': ['all'"
        }
    ],
    "version": "0.1.0"
}

I had no option to re-open the existing issue, so I'm creating a new one.

@proycon proycon self-assigned this Sep 26, 2023
@proycon proycon added the bug Something isn't working label Sep 26, 2023
@apirogov
Copy link
Author

This also interacts with #39

For example in our project I get now alternatingly

             "identifier": "'version':",
             "name": "'version':",
             "runtimePlatform": "Python 3",
-            "version": "'^2.4.2'}"
+            "version": "'^0.7.0'}"
         },
         {
             "@type": "SoftwareApplication",
             "identifier": "'version':",
             "name": "'version':",
             "runtimePlatform": "Python 3",
-            "version": "'^0.7.0'}"
+            "version": "'^2.4.2'}"
         },
         {
             "@type": "SoftwareApplication",

and

             "identifier": "'version':",
             "name": "'version':",
             "runtimePlatform": "Python 3",
-            "version": "'^0.7.0'}"
+            "version": "'^2.4.2'}"
         },
         {
             "@type": "SoftwareApplication",
             "identifier": "'version':",
             "name": "'version':",
             "runtimePlatform": "Python 3",
-            "version": "'^2.4.2'}"
+            "version": "'^0.7.0'}"
         },
         {
             "@type": "SoftwareApplication",

Not sure if this nondeterminism is only with these "broken" incorrect dependencies, or there's still a general problem with the other non-determinism issue.

proycon added a commit that referenced this issue Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants