Skip to content

Commit

Permalink
#183 - Update link references of ownership from nexB to aboutcode-org
Browse files Browse the repository at this point in the history
Signed-off-by: Chin Yeung Li <[email protected]>
  • Loading branch information
chinyeungli committed Aug 9, 2024
1 parent 6087a37 commit 869c412
Show file tree
Hide file tree
Showing 22 changed files with 124 additions and 72 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

v0.12.1
-----------

- Update link references of ownership from nexB to aboutcode-org


v0.12.0
-----------

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#

Expand Down
23 changes: 21 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -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.

#
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -36,15 +36,15 @@ Testing
pytest -vvs

- These are live tests to regenrate the tests with updated data run::

PYINSP_REGEN_TEST_FIXTURES=yes pytest -vvs

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::

Expand All @@ -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


2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#

Expand Down
2 changes: 1 addition & 1 deletion configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
6 changes: 3 additions & 3 deletions docs/source/test-protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,21 @@ 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

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
Expand Down
2 changes: 1 addition & 1 deletion requirements_builder.ABOUT
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [email protected]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [email protected]
Expand Down
2 changes: 1 addition & 1 deletion src/_packagedcode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
4 changes: 2 additions & 2 deletions src/_packagedcode/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#

Expand Down Expand Up @@ -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.',
Expand Down
12 changes: 6 additions & 6 deletions src/_packagedcode/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#

Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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())
Expand Down
12 changes: 6 additions & 6 deletions src/_packagedcode/pypi_setup_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#

Expand Down Expand Up @@ -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')
Expand Down
7 changes: 4 additions & 3 deletions src/_packagedcode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#

Expand Down Expand Up @@ -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

Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion src/python_inspector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#

Expand Down
34 changes: 22 additions & 12 deletions src/python_inspector/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#

Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Loading

0 comments on commit 869c412

Please sign in to comment.