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

manifest_path is mostly empty for packages #1718

Closed
pombredanne opened this issue Sep 9, 2019 · 1 comment
Closed

manifest_path is mostly empty for packages #1718

pombredanne opened this issue Sep 9, 2019 · 1 comment

Comments

@pombredanne
Copy link
Member

Description

with:

wget https://files.pythonhosted.org/packages/de/6b/65b4a2ee355a1ea1b78bdc858e314e767cedcc44e8aaf9cd46e4da41674b/license_expression-0.999-py2.py3-none-any.whl
extractcode license_expression-0.999-py2.py3-none-any.whl
scancode --package --json-pp - license_expression-0.999-py2.py3-none-any.whl-extract/ --verbose --only-findings

I get this error:


Setup plugins...
Collect file inventory...
Scan files for: packages with 1 process(es)...
[####################] 8                              
ERROR: failed to run scan plugin: packages:
Traceback (most recent call last):
  File "/home/pombreda/w421/scancode-toolkit/src/scancode/cli.py", line 1033, in run_codebase_plugins
    plugin.process_codebase(codebase, **kwargs)
  File "/home/pombreda/w421/scancode-toolkit/src/packagedcode/plugin_package.py", line 165, in process_codebase
    new_manifest_path = os.path.join(parent_directory(new_package_root.path), resource.name)
NameError: name 'os' is not defined

{
  "headers": [
    {
      "tool_name": "scancode-toolkit",
      "tool_version": "3.1.1",
      "options": {
        "input": [
          "license_expression-0.999-py2.py3-none-any.whl-extract/"
        ],
        "--json-pp": "-",
        "--only-findings": true,
        "--package": true
      },
      "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
      "start_timestamp": "2019-09-09T064201.232217",
      "end_timestamp": "2019-09-09T064202.026168",
      "message": null,
      "errors": [
        "ERROR: failed to run scan plugin: packages:\nTraceback (most recent call last):\n  File \"/home/pombreda/w421/scancode-toolkit/src/scancode/cli.py\", line 1033, in run_codebase_plugins\n    plugin.process_codebase(codebase, **kwargs)\n  File \"/home/pombreda/w421/scancode-toolkit/src/packagedcode/plugin_package.py\", line 165, in process_codebase\n    new_manifest_path = os.path.join(parent_directory(new_package_root.path), resource.name)\nNameError: name 'os' is not defined\n"
      ],
      "extra_data": {
        "files_count": 1
      }
    }
  ],
  "files": [
    {
      "path": "license_expression-0.999-py2.py3-none-any.whl-extract/license_expression/_pyahocorasick.ABOUT",
      "type": "file",
      "packages": [
        {
          "type": "about",
          "namespace": null,
          "name": "pyahocorasick-python",
          "version": "ec2fb9",
          "qualifiers": null,
          "subpath": null,
          "primary_language": null,
          "description": null,
          "release_date": null,
          "parties": [
            {
              "type": "person",
              "role": "owner",
              "name": "nexB Inc.",
              "email": null,
              "url": null
            }
          ],
          "keywords": [],
          "homepage_url": "https://github.com/WojciechMula/pyahocorasick",
          "download_url": "https://github.com/WojciechMula/pyahocorasick/tree/ec2fb9cb393f571fd4316ea98ed7b65992f16127/py",
          "size": null,
          "sha1": null,
          "md5": null,
          "sha256": null,
          "sha512": null,
          "bug_tracking_url": null,
          "code_view_url": null,
          "vcs_url": null,
          "copyright": "originally authored by Wojciech Mula, modified by the license_expression authors.",
          "license_expression": "public-domain",
          "declared_license": "public-domain",
          "notice_text": null,
          "manifest_path": null,
          "dependencies": [],
          "contains_source_code": null,
          "source_packages": [],
          "purl": "pkg:about/pyahocorasick-python@ec2fb9",
          "repository_homepage_url": null,
          "repository_download_url": null,
          "api_data_url": null
        }
      ],
      "scan_errors": []
    }
  ]
}
Scanning done.
Some files failed to scan properly:
ERROR: failed to run scan plugin: packages:
Traceback (most recent call last):
  File "/home/pombreda/w421/scancode-toolkit/src/scancode/cli.py", line 1033, in run_codebase_plugins
    plugin.process_codebase(codebase, **kwargs)
  File "/home/pombreda/w421/scancode-toolkit/src/packagedcode/plugin_package.py", line 165, in process_codebase
    new_manifest_path = os.path.join(parent_directory(new_package_root.path), resource.name)
NameError: name 'os' is not defined
Summary:        packages with 1 process(es)
Errors count:   1
Scan Speed:     68.09 files/sec. 
Initial counts: 11 resource(s): 8 file(s) and 3 directorie(s) 
Final counts:   1 resource(s): 1 file(s) and 0 directorie(s) 
Timings:
  scan_start: 2019-09-09T064201.232217
  scan_end:   2019-09-09T064202.026168
  setup_scan:licenses: 0.67s
  setup: 0.67s
  scan: 0.12s
  total: 0.80s
Removing temporary files...done.


System configuration

For bug reports, it really helps us to know:

  • What OS are you running on? Linux Python 2.7
  • What version of scancode-toolkit was used to generate the scan file? v3.1.1 pre release
  • What installation method was used to install/run scancode? standard archive
@pombredanne pombredanne added the bug label Sep 9, 2019
adityaviki added a commit to adityaviki/scancode-toolkit that referenced this issue Sep 13, 2019
Added import for os.path and parent_directory to fix the issue

Signed-off-by: Aditya Viki <[email protected]>
pombredanne added a commit that referenced this issue Sep 19, 2019
Add missing imports #1718 #1735

Signed-off-by: Philippe Ombredanne <[email protected]>
aj4ayushjain pushed a commit to aj4ayushjain/scancode-toolkit that referenced this issue Sep 28, 2019
Added import for os.path and parent_directory to fix the issue

Signed-off-by: Aditya Viki <[email protected]>
@pombredanne
Copy link
Member Author

The base fix has been contributed by @adityaviki (Thanks! )
The follow on related work is tracked in #1237 (comment)

viragumathe5 pushed a commit to viragumathe5/scancode-toolkit that referenced this issue Mar 13, 2020
Added import for os.path and parent_directory to fix the issue

Signed-off-by: Aditya Viki <[email protected]>
pombredanne pushed a commit that referenced this issue Sep 8, 2022
Web accessibility is important. Unfortunately currently many pygments
styles have rules with poor contrasts. This commit introduces a test
case that fails if the minimum contrast of a style gets worse, e.g:

E  AssertionError: contrast degradation for style 'borland'
E    The following rules have a contrast lower than the required 2.9:
E
E    * 1.90 Token.Text.Whitespace
E    * 2.80 Token.Generic.Heading
E    * 2.30 Token.Generic.Subheading
E
E  assert not 1.9 < 2.9

This is accomplished by storing the current minimum contrasts in
./tests/contrast/min_contrasts.json.

When you improve a minimum contrast the test fails with:

E  AssertionError: congrats, you improved a contrast! please run ./scripts/update_contrasts.py
E  assert not 1.9 > 0.9

Running the script as instructed updates the JSON file, making the test pass.

New styles are required to meet the WCAG AA contrast minimum of 4.5.

First commit to address #1718.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant