From 869c4124ac0bbc7ee333886c9f9dd1a7fe92db2a Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Fri, 9 Aug 2024 14:24:27 +0800 Subject: [PATCH] #183 - Update link references of ownership from nexB to aboutcode-org Signed-off-by: Chin Yeung Li --- CHANGELOG.rst | 6 +++++ Makefile | 2 +- NOTICE | 23 ++++++++++++++-- README.rst | 10 +++---- configure | 2 +- configure.bat | 2 +- docs/source/test-protocol.rst | 6 ++--- requirements_builder.ABOUT | 2 +- setup.cfg | 2 +- src/_packagedcode/__init__.py | 2 +- src/_packagedcode/models.py | 4 +-- src/_packagedcode/pypi.py | 12 ++++----- src/_packagedcode/pypi_setup_py.py | 12 ++++----- src/_packagedcode/utils.py | 7 ++--- src/python_inspector/__init__.py | 2 +- src/python_inspector/api.py | 34 +++++++++++++++--------- src/python_inspector/cli_utils.py | 5 ++-- src/python_inspector/error.py | 2 +- src/python_inspector/package_data.py | 5 ++-- src/python_inspector/resolution.py | 39 ++++++++++++++++++---------- src/python_inspector/resolve_cli.py | 15 ++++++----- src/python_inspector/utils.py | 2 +- 22 files changed, 124 insertions(+), 72 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 093f471d..2b42f90a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ Changelog ========= +v0.12.1 +----------- + +- Update link references of ownership from nexB to aboutcode-org + + v0.12.0 ----------- diff --git a/Makefile b/Makefile index a3da02ef..a88f4c68 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/python-inspector for support or download. +# See https://github.com/aboutcode-org/python-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/NOTICE b/NOTICE index 5f0a4189..41efd68e 100644 --- a/NOTICE +++ b/NOTICE @@ -1,20 +1,39 @@ # + # Copyright (c) nexB Inc. and others. + # SPDX-License-Identifier: Apache-2.0 + # -# Visit https://aboutcode.org and https://github.com/nexB/python-inspector + +# Visit https://aboutcode.org and https://github.com/aboutcode-org/python-inspector + # for support and download. + # ScanCode is a trademark of nexB Inc. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # -# http://www.apache.org/licenses/LICENSE-2.0 + +# http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # diff --git a/README.rst b/README.rst index 39dbacb0..5faa3774 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ python-inspector - inspect Python packages dependencies and metadata Copyright (c) nexB Inc. and others. SPDX-License-Identifier: Apache-2.0 -Homepage: https://github.com/nexB/python-inspector and https://www.aboutcode.org/ +Homepage: https://github.com/aboutcode-org/python-inspector and https://www.aboutcode.org/ ``python-inspector`` is a collection of utilities to: @@ -36,7 +36,7 @@ Testing pytest -vvs - These are live tests to regenrate the tests with updated data run:: - + PYINSP_REGEN_TEST_FIXTURES=yes pytest -vvs Usage @@ -44,7 +44,7 @@ Usage - Install with pip:: - pip install git+https://github.com/nexB/python-inspector + pip install git+https://github.com/aboutcode-org/python-inspector - Run the command line utility with:: @@ -71,5 +71,5 @@ Its companion libraries are: installed site-packages and their metadata formats. - ``packageurl-python`` to use Package URL to reference Python packages - - + + diff --git a/configure b/configure index 926a894e..22d92885 100755 --- a/configure +++ b/configure @@ -3,7 +3,7 @@ # Copyright (c) nexB Inc. and others. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/ for support or download. +# See https://github.com/aboutcode-org/ for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/configure.bat b/configure.bat index 5e95b311..5b9a9d68 100644 --- a/configure.bat +++ b/configure.bat @@ -4,7 +4,7 @@ @rem Copyright (c) nexB Inc. and others. All rights reserved. @rem SPDX-License-Identifier: Apache-2.0 @rem See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -@rem See https://github.com/nexB/ for support or download. +@rem See https://github.com/aboutcode-org/ for support or download. @rem See https://aboutcode.org for more information about nexB OSS projects. diff --git a/docs/source/test-protocol.rst b/docs/source/test-protocol.rst index 6e1d365d..081c24f6 100644 --- a/docs/source/test-protocol.rst +++ b/docs/source/test-protocol.rst @@ -161,13 +161,13 @@ Another example could be https://github.com/digitalocean/sample-django We use the latest main branch from python-inspector and scancode-toolkit 31.0.0rc2 installed on Linux with Python 3.8 using the release tarball from: -https://github.com/nexB/scancode-toolkit/releases/tag/v31.0.0rc2 +https://github.com/aboutcode-org/scancode-toolkit/releases/tag/v31.0.0rc2 ScanCode setup:: mkdir -p ~/tmp/pyinsp-example/tools cd ~/tmp/pyinsp-example/tools - wget https://github.com/nexB/scancode-toolkit/releases/download/v31.0.0rc2/scancode-toolkit-31.0.0rc2_py38-linux.tar.xz + wget https://github.com/aboutcode-org/scancode-toolkit/releases/download/v31.0.0rc2/scancode-toolkit-31.0.0rc2_py38-linux.tar.xz tar -xf scancode-toolkit-31.0.0rc2_py38-linux.tar.xz cd scancode-toolkit-31.0.0rc2/ ./scancode --help @@ -175,7 +175,7 @@ ScanCode setup:: python-inspector setup:: cd ~/tmp/pyinsp-example/tools - git clone https://github.com/nexB/python-inspector + git clone https://github.com/aboutcode-org/python-inspector python3.8 -m venv venv source venv/bin/activate pip install --upgrade pip setuptools wheel diff --git a/requirements_builder.ABOUT b/requirements_builder.ABOUT index 5407b2b2..251c9de6 100644 --- a/requirements_builder.ABOUT +++ b/requirements_builder.ABOUT @@ -6,7 +6,7 @@ license = Apache-2.0 description = python-inspector is is a collection of utilities to collect PyPI package metadata and resolve packages dependencies. long_description = file:README.rst long_description_content_type = text/x-rst -url = https://github.com/nexB/python-inspector +url = https://github.com/aboutcode-org/python-inspector author = nexB. Inc. and others author_email = info@aboutcode.org diff --git a/setup.cfg b/setup.cfg index 46fab955..6d8f566c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ license = Apache-2.0 description = python-inspector is is a collection of utilities to collect PyPI package metadata and resolve packages dependencies. long_description = file:README.rst long_description_content_type = text/x-rst -url = https://github.com/nexB/python-inspector +url = https://github.com/aboutcode-org/python-inspector author = nexB. Inc. and others author_email = info@aboutcode.org diff --git a/src/_packagedcode/__init__.py b/src/_packagedcode/__init__.py index 983aaf0b..3e488e98 100644 --- a/src/_packagedcode/__init__.py +++ b/src/_packagedcode/__init__.py @@ -3,6 +3,6 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/scancode-toolkit for support or download. +# See https://github.com/aboutcode-org/scancode-toolkit for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/src/_packagedcode/models.py b/src/_packagedcode/models.py index 4fa67c00..2796499e 100644 --- a/src/_packagedcode/models.py +++ b/src/_packagedcode/models.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/scancode-toolkit for support or download. +# See https://github.com/aboutcode-org/scancode-toolkit for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -373,7 +373,7 @@ class DependentPackage(ModelMixin): 'either from the datafile or collected from another source. Some ' 'lockfiles for Composer or Cargo contain extra dependency data.' ) - + extra_data = Mapping( label='extra data', help='A mapping of arbitrary extra data.', diff --git a/src/_packagedcode/pypi.py b/src/_packagedcode/pypi.py index 962bafde..4f5b2a61 100644 --- a/src/_packagedcode/pypi.py +++ b/src/_packagedcode/pypi.py @@ -4,7 +4,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/scancode-toolkit for support or download. +# See https://github.com/aboutcode-org/scancode-toolkit for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -457,7 +457,7 @@ def parse_metadata(location, datasource_id, package_type): name=name, version=version, description=get_description(metainfo=meta, location=str(location)), - #TODO: https://github.com/nexB/scancode-toolkit/issues/3014 + #TODO: https://github.com/aboutcode-org/scancode-toolkit/issues/3014 declared_license=get_declared_license(meta), keywords=get_keywords(meta), parties=get_parties(meta), @@ -781,7 +781,7 @@ def parse(cls, location): def parse_reqs(cls, reqs, scope): """ Parse a list of requirements and return a list of dependencies - """ + """ dependent_packages = [] for req in reqs: req_parsed = packaging.requirements.Requirement(str(req)) @@ -816,7 +816,7 @@ def get_resolved_purl(purl: PackageURL, specifiers: SpecifierSet): return ResolvedPurl( purl=purl, is_resolved=is_resolved, - ) + ) class PipfileHandler(BaseDependencyFileHandler): datasource_id = 'pipfile' @@ -918,7 +918,7 @@ def get_requirements_txt_dependencies(location, include_nested=False): if isinstance(value, list): extra_data[name].extend(value) else: - extra_data[name] = value + extra_data[name] = value dependent_packages = [] for req in req_file.requirements: @@ -987,7 +987,7 @@ def can_process_dependent_package(dep: models.DependentPackage): requirement_flags.pop("hash_options", None) if not requirement_flags: return True - # we can not process the requirement if it has any flag set + # we can not process the requirement if it has any flag set # because this means it is not a standard specifier # but rather some pip specific option of sorts return not any(requirement_flags.values()) diff --git a/src/_packagedcode/pypi_setup_py.py b/src/_packagedcode/pypi_setup_py.py index e7f55c7a..e7ddee72 100644 --- a/src/_packagedcode/pypi_setup_py.py +++ b/src/_packagedcode/pypi_setup_py.py @@ -2,7 +2,7 @@ # Copyright (c) Gram and others. # This code is copied and modified from dephell_setuptools https://github.com/pypa/setuptools # SPDX-License-Identifier: MIT -# See https://github.com/nexB/scancode-toolkit for support or download. +# See https://github.com/aboutcode-org/scancode-toolkit for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -192,11 +192,11 @@ def clean_setup(data): Return a cleaned mapping from a setup ``data`` mapping. """ result = {k: v - for k, v in data.items() - if k in FIELDS - and (v and v is not False) - and str(v) != 'UNKNOWN' - } + for k, v in data.items() + if k in FIELDS + and (v and v is not False) + and str(v) != 'UNKNOWN' + } # split keywords in words keywords = result.get('keywords') diff --git a/src/_packagedcode/utils.py b/src/_packagedcode/utils.py index 1cddc775..161cf7e1 100644 --- a/src/_packagedcode/utils.py +++ b/src/_packagedcode/utils.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/scancode-toolkit for support or download. +# See https://github.com/aboutcode-org/scancode-toolkit for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -123,7 +123,7 @@ def build_description(summary, description): description = summary else: if summary and summary not in description: - description = '\n'.join([summary , description]) + description = '\n'.join([summary, description]) return description @@ -142,7 +142,8 @@ def combine_expressions( license ``expressions`` strings or LicenseExpression objects. """ if not licensing: - raise Exception('combine_expressions: cannot combine combine_expressions without license_expression package.') + raise Exception( + 'combine_expressions: cannot combine combine_expressions without license_expression package.') return expressions and str(le_combine_expressions(expressions, relation, unique, licensing)) or None diff --git a/src/python_inspector/__init__.py b/src/python_inspector/__init__.py index b1a3a645..a990b071 100644 --- a/src/python_inspector/__init__.py +++ b/src/python_inspector/__init__.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/scancode-toolkit for support or download. +# See https://github.com/aboutcode-org/scancode-toolkit for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/src/python_inspector/api.py b/src/python_inspector/api.py index ce98ff31..a64d0c17 100644 --- a/src/python_inspector/api.py +++ b/src/python_inspector/api.py @@ -5,7 +5,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/python-inspector for support or download. +# See https://aboutcode-orgnexB/python-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -64,7 +64,8 @@ def to_dict(self, generic_paths=False): # clean file paths for file in files: path = file["path"] - file["path"] = utils.remove_test_data_dir_variable_prefix(path=path) + file["path"] = utils.remove_test_data_dir_variable_prefix( + path=path) return { "files": files, "packages": [package for package in self.packages], @@ -151,16 +152,20 @@ def resolve_dependencies( # requirements for req_file in requirement_files: - deps = dependencies.get_dependencies_from_requirements(requirements_file=req_file) + deps = dependencies.get_dependencies_from_requirements( + requirements_file=req_file) for extra_data in dependencies.get_extra_data_from_requirements(requirements_file=req_file): - index_urls = (*index_urls, *tuple(extra_data.get("extra_index_urls") or [])) - index_urls = (*index_urls, *tuple(extra_data.get("index_url") or [])) + index_urls = ( + *index_urls, *tuple(extra_data.get("extra_index_urls") or [])) + index_urls = ( + *index_urls, *tuple(extra_data.get("index_url") or [])) direct_dependencies.extend(deps) package_data = [ pkg_data.to_dict() for pkg_data in PipRequirementsFileHandler.parse(location=req_file) ] if generic_paths: - req_file = utils.remove_test_data_dir_variable_prefix(path=req_file) + req_file = utils.remove_test_data_dir_variable_prefix( + path=req_file) files.append( dict( @@ -213,13 +218,15 @@ def resolve_dependencies( files=[setup_py_file], analyze_setup_py_insecurely=analyze_setup_py_insecurely, ) - setup_py_file_deps = list(get_dependent_packages_from_reqs(reqs)) + setup_py_file_deps = list( + get_dependent_packages_from_reqs(reqs)) direct_dependencies.extend(setup_py_file_deps) package_data.dependencies = setup_py_file_deps file_package_data = [package_data.to_dict()] if generic_paths: - setup_py_file = utils.remove_test_data_dir_variable_prefix(path=setup_py_file) + setup_py_file = utils.remove_test_data_dir_variable_prefix( + path=setup_py_file) files.append( dict( type="file", @@ -260,9 +267,11 @@ def resolve_dependencies( else: credentials = None if parsed_netrc: - login, password = utils.get_netrc_auth(index_url, parsed_netrc) + login, password = utils.get_netrc_auth( + index_url, parsed_netrc) credentials = ( - dict(login=login, password=password) if login and password else None + dict(login=login, + password=password) if login and password else None ) repo = utils_pypi.PypiSimpleRepository( index_url=index_url, @@ -382,7 +391,8 @@ def get_resolved_dependencies( ), reporter=BaseReporter(), ) - resolver_results = resolver.resolve(requirements=requirements, max_rounds=max_rounds) + resolver_results = resolver.resolve( + requirements=requirements, max_rounds=max_rounds) package_list = get_package_list(results=resolver_results) if pdt_output: return (format_pdt_tree(resolver_results), package_list) @@ -401,7 +411,7 @@ def get_requirements_from_direct_dependencies( for dependency in direct_dependencies: # FIXME We are skipping editable requirements # and other pip options for now - # https://github.com/nexB/python-inspector/issues/41 + # https://github.com/aboutcode-org/python-inspector/issues/41 if not can_process_dependent_package(dependency): continue req = Requirement(requirement_string=dependency.extracted_requirement) diff --git a/src/python_inspector/cli_utils.py b/src/python_inspector/cli_utils.py index aba3190d..4b94cde2 100644 --- a/src/python_inspector/cli_utils.py +++ b/src/python_inspector/cli_utils.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/scancode-toolkit for support or download. +# See https://github.com/aboutcode-org/scancode-toolkit for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -21,7 +21,8 @@ class FileOptionType(click.File): def convert(self, value, param, ctx): known_opts = set( - chain.from_iterable(p.opts for p in ctx.command.params if isinstance(p, click.Option)) + chain.from_iterable( + p.opts for p in ctx.command.params if isinstance(p, click.Option)) ) if value in known_opts: self.fail( diff --git a/src/python_inspector/error.py b/src/python_inspector/error.py index 85f3cdc4..eb11934a 100644 --- a/src/python_inspector/error.py +++ b/src/python_inspector/error.py @@ -5,7 +5,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/python-inspector for support or download. +# See https://github.com/aboutcode-org/python-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/src/python_inspector/package_data.py b/src/python_inspector/package_data.py index 023b5159..a320bf80 100644 --- a/src/python_inspector/package_data.py +++ b/src/python_inspector/package_data.py @@ -5,7 +5,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/python-inspector for support or download. +# See https://github.com/aboutcode-org/python-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -53,7 +53,8 @@ def get_pypi_data_from_purl( project_urls = info.get("project_urls") or {} code_view_url = get_pypi_codeview_url(project_urls) bug_tracking_url = get_pypi_bugtracker_url(project_urls) - python_version = get_python_version_from_env_tag(python_version=environment.python_version) + python_version = get_python_version_from_env_tag( + python_version=environment.python_version) valid_distribution_urls = [] valid_distribution_urls.append( diff --git a/src/python_inspector/resolution.py b/src/python_inspector/resolution.py index 452d10ff..f160b113 100644 --- a/src/python_inspector/resolution.py +++ b/src/python_inspector/resolution.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: ISC AND Apache-2.0 # derived and heavily modified from https://github.com/sarugaku/resolvelib -# See https://github.com/nexB/python-inspector for support or download. +# See https://github.com/aboutcode-org/python-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -210,13 +210,15 @@ def get_sdist_file_path_from_filename(sdist): sdist_file = sdist.rstrip(".tar.gz") with tarfile.open(os.path.join(utils_pypi.CACHE_THIRDPARTY_DIR, sdist)) as file: file.extractall( - os.path.join(utils_pypi.CACHE_THIRDPARTY_DIR, "extracted_sdists", sdist_file) + os.path.join(utils_pypi.CACHE_THIRDPARTY_DIR, + "extracted_sdists", sdist_file) ) elif sdist.endswith(".zip"): sdist_file = sdist.rstrip(".zip") with ZipFile(os.path.join(utils_pypi.CACHE_THIRDPARTY_DIR, sdist)) as zip: zip.extractall( - os.path.join(utils_pypi.CACHE_THIRDPARTY_DIR, "extracted_sdists", sdist_file) + os.path.join(utils_pypi.CACHE_THIRDPARTY_DIR, + "extracted_sdists", sdist_file) ) else: @@ -241,7 +243,7 @@ def get_requirements_from_dependencies( # FIXME We are skipping editable requirements # and other pip options for now - # https://github.com/nexB/python-inspector/issues/41 + # https://github.com/aboutcode-org/python-inspector/issues/41 if can_process_dependent_package(dep): yield Requirement(str(dep.extracted_requirement)) @@ -359,7 +361,8 @@ def __init__( ignore_errors=False, ): self.environment = environment - self.environment_marker = get_environment_marker_from_environment(self.environment) + self.environment_marker = get_environment_marker_from_environment( + self.environment) self.repos = repos or [] self.versions_by_package = {} self.dependencies_by_purl = {} @@ -408,9 +411,11 @@ def get_versions_for_package_from_repo( versions = [] for version, package in repo.get_package_versions(name).items(): python_version = parse_version( - get_python_version_from_env_tag(python_version=self.environment.python_version) + get_python_version_from_env_tag( + python_version=self.environment.python_version) ) - wheels = list(package.get_supported_wheels(environment=self.environment)) + wheels = list(package.get_supported_wheels( + environment=self.environment)) valid_wheel_present = False pypi_valid_python_version = False if wheels: @@ -459,7 +464,8 @@ def get_requirements_for_package_from_pypi_simple( Return requirements for a package from the simple repositories. """ python_version = parse_version( - get_python_version_from_env_tag(python_version=self.environment.python_version) + get_python_version_from_env_tag( + python_version=self.environment.python_version) ) wheels = utils_pypi.download_wheel( @@ -472,7 +478,8 @@ def get_requirements_for_package_from_pypi_simple( if wheels: for wheel in wheels: - wheel_location = os.path.join(utils_pypi.CACHE_THIRDPARTY_DIR, wheel) + wheel_location = os.path.join( + utils_pypi.CACHE_THIRDPARTY_DIR, wheel) requirements = get_requirements_from_distribution( handler=PypiWheelHandler, location=wheel_location, @@ -564,7 +571,8 @@ def get_candidates( ): valid_versions.append(parsed_version) if not all(version.is_prerelease for version in valid_versions): - valid_versions = [version for version in valid_versions if not version.is_prerelease] + valid_versions = [ + version for version in valid_versions if not version.is_prerelease] for version in valid_versions: yield Candidate(name=name, version=version, extras=extras) @@ -585,7 +593,8 @@ def _iter_matches( versions.extend(self.get_versions_for_package(name=name)) else: for repo in self.repos: - versions.extend(self.get_versions_for_package(name=name, repo=repo)) + versions.extend( + self.get_versions_for_package(name=name, repo=repo)) if not versions: if self.ignore_errors: @@ -629,7 +638,7 @@ def _iter_dependencies(self, candidate: Candidate) -> Generator[Requirement, Non Yield dependencies for the given candidate. """ name = packvers.utils.canonicalize_name(candidate.name) - # TODO: handle extras https://github.com/nexB/python-inspector/issues/10 + # TODO: handle extras https://github.com/aboutcode-org/python-inspector/issues/10 if candidate.extras: r = f"{name}=={candidate.version}" yield Requirement(r) @@ -676,7 +685,8 @@ def dfs(mapping: Dict, graph: DirectedGraph, src: str): return dict( package=str(src_purl), - dependencies=sorted([dfs(mapping, graph, c) for c in children], key=lambda d: d["package"]), + dependencies=sorted([dfs(mapping, graph, c) + for c in children], key=lambda d: d["package"]), ) @@ -794,7 +804,8 @@ def get_setup_requirements(sdist_location: str, setup_py_location: str, setup_cf """ if not os.path.exists(setup_py_location) and not os.path.exists(setup_cfg_location): - raise Exception(f"No setup.py or setup.cfg found in pypi sdist {sdist_location}") + raise Exception( + f"No setup.py or setup.cfg found in pypi sdist {sdist_location}") # Some commonon packages like flask may have some dependencies in setup.cfg # and some dependencies in setup.py. We are going to check both. diff --git a/src/python_inspector/resolve_cli.py b/src/python_inspector/resolve_cli.py index 047a8c78..a8670d11 100644 --- a/src/python_inspector/resolve_cli.py +++ b/src/python_inspector/resolve_cli.py @@ -5,7 +5,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/python-inspector for support or download. +# See https://github.com/aboutcode-org/python-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -84,7 +84,8 @@ def print_version(ctx, param, value): metavar="OS", show_default=True, required=True, - help="OS to use for dependency resolution. One of " + ", ".join(utils_pypi.PLATFORMS_BY_OS), + help="OS to use for dependency resolution. One of " + + ", ".join(utils_pypi.PLATFORMS_BY_OS), ) @click.option( "--index-url", @@ -228,7 +229,8 @@ def resolve_dependencies( from python_inspector.api import resolve_dependencies as resolver_api if not (json_output or pdt_output): - click.secho("No output file specified. Use --json or --json-pdt.", err=True) + click.secho( + "No output file specified. Use --json or --json-pdt.", err=True) ctx.exit(1) if json_output and pdt_output: @@ -240,12 +242,12 @@ def resolve_dependencies( notice = ( "Dependency tree generated with python-inspector.\n" "python-inspector is a free software tool from nexB Inc. and others.\n" - "Visit https://github.com/nexB/python-inspector/ for support and download." + "Visit https://github.com/aboutcode-org/python-inspector/ for support and download." ) headers = dict( tool_name="python-inspector", - tool_homepageurl="https://github.com/nexB/python-inspector", + tool_homepageurl="https://github.com/aboutcode-org/python-inspector", tool_version=__version__, options=options, notice=notice, @@ -337,7 +339,8 @@ def get_pretty_options(ctx, generic_paths=False): value = [value] for val in value: - val = get_pretty_value(param_type=param.type, value=val, generic_paths=generic_paths) + val = get_pretty_value(param_type=param.type, + value=val, generic_paths=generic_paths) if isinstance(param, click.Argument): args.append(val) diff --git a/src/python_inspector/utils.py b/src/python_inspector/utils.py index 9bdf6223..9f5b0900 100644 --- a/src/python_inspector/utils.py +++ b/src/python_inspector/utils.py @@ -5,7 +5,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/python-inspector for support or download. +# See https://github.com/aboutcode-org/python-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. #