Skip to content

Commit

Permalink
Merge pull request #267 from nexB/247-create-purl-cli-tool
Browse files Browse the repository at this point in the history
Create PURL CLI tool and library
  • Loading branch information
JonoYang authored Jan 19, 2024
2 parents e1a2000 + 5e5c28e commit 86bce5f
Show file tree
Hide file tree
Showing 12 changed files with 942 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ process_scans:

test:
@echo "-> Run the test suite"
${ACTIVATE} DJANGO_SETTINGS_MODULE=purldb_project.settings ${PYTHON_EXE} -m pytest -vvs --ignore matchcode-toolkit --ignore packagedb/tests/test_throttling.py
${ACTIVATE} DJANGO_SETTINGS_MODULE=purldb_project.settings ${PYTHON_EXE} -m pytest -vvs --ignore matchcode-toolkit --ignore purldb-toolkit --ignore packagedb/tests/test_throttling.py
${ACTIVATE} DJANGO_SETTINGS_MODULE=purldb_project.settings ${PYTHON_EXE} -m pytest -vvs packagedb/tests/test_throttling.py
${ACTIVATE} ${PYTHON_EXE} -m pytest -vvs matchcode-toolkit --ignore matchcode-toolkit/src/matchcode_toolkit/pipelines
${ACTIVATE} ${PYTHON_EXE} -m pytest -vvs purldb-toolkit

shell:
${MANAGE} shell
Expand Down
6 changes: 3 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ CLI_ARGS=$1
CUSTOM_PACKAGES=""

# Requirement arguments passed to pip and used by default or with --dev.
REQUIREMENTS="$CUSTOM_PACKAGES --editable matchcode-toolkit --editable . --constraint requirements.txt"
DEV_REQUIREMENTS="$CUSTOM_PACKAGES --editable matchcode-toolkit --editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
DOCS_REQUIREMENTS="$CUSTOM_PACKAGES --editable matchcode-toolkit --editable .[docs] --constraint requirements.txt"
REQUIREMENTS="$CUSTOM_PACKAGES --editable matchcode-toolkit --editable purldb-toolkit --editable . --constraint requirements.txt"
DEV_REQUIREMENTS="$CUSTOM_PACKAGES --editable matchcode-toolkit --editable purldb-toolkit --editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
DOCS_REQUIREMENTS="$CUSTOM_PACKAGES --editable matchcode-toolkit --editable purldb-toolkit --editable .[docs] --constraint requirements.txt"

# where we create a virtualenv
VIRTUALENV_DIR=venv
Expand Down
4 changes: 2 additions & 2 deletions minecode/tests/testfiles/directories/ls-lr-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@
"path":"dists/experimental/InRelease",
"type":"f",
"size":187349,
"date":"2023-01",
"date":"2024-01",
"target":null
},
{
"path":"dists/experimental/Release.gpg",
"type":"f",
"size":1554,
"date":"2023-01",
"date":"2024-01",
"target":null
},
{
Expand Down
14 changes: 14 additions & 0 deletions purldb-toolkit/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
PurlDB toolkit
==============
[To come.]

Installation
------------

[To come.]


Usage
-----

[To come.]
56 changes: 56 additions & 0 deletions purldb-toolkit/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[project]
name = "purldb-toolkit"
version = "0.0.1"

[build-system]
requires = ["setuptools == 68.2.2", "wheel", "setuptools_scm[toml] >= 6"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# this is used populated when creating a git archive
# and when there is .git dir and/or there is no git installed
fallback_version = "9999.$Format:%h-%cs$"

[tool.pytest.ini_options]
norecursedirs = [
".git",
"bin",
"dist",
"build",
"_build",
"dist",
"etc",
"local",
"ci",
"docs",
"man",
"share",
"samples",
".cache",
".settings",
"Include",
"include",
"Lib",
"lib",
"lib64",
"Lib64",
"Scripts",
"thirdparty",
"tmp",
"venv",
"tests/data",
".eggs",
"src/*/data",
"tests/*/data"
]

python_files = "*.py"

python_classes = "Test"
python_functions = "test"

addopts = [
"-rfExXw",
"--strict-markers",
"--doctest-modules"
]
66 changes: 66 additions & 0 deletions purldb-toolkit/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[metadata]
name = purldb-toolkit
version = 0.0.1
license = Apache-2.0

# description must be on ONE line https://github.com/pypa/setuptools/issues/1390
description = purldb-toolkit
long_description = file:README.rst
long_description_content_type = text/x-rst
url = https://github.com/nexB/purldb/tree/main/purldb-toolkit

author = nexB. Inc. and others
author_email = [email protected]

classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Topic :: Software Development
Topic :: Utilities

keywords =
utilities

license_files =
apache-2.0.LICENSE
NOTICE
AUTHORS.rst
CHANGELOG.rst

[options]
package_dir =
=src
packages = find:
include_package_data = true
zip_safe = false

setup_requires = setuptools_scm[toml] >= 4

python_requires = >=3.7

install_requires =
click
fetchcode
requests
packageurl-python

[options.packages.find]
where = src


[options.extras_require]
testing =
pytest >= 6, != 7.0.0
pytest-xdist >= 2
aboutcode-toolkit >= 6.0.0
black

docs =
Sphinx >= 3.3.1
sphinx-rtd-theme >= 0.5.0
doc8 >= 0.8.1


[options.entry_points]
6 changes: 6 additions & 0 deletions purldb-toolkit/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env python

import setuptools

if __name__ == "__main__":
setuptools.setup()
Empty file.
Loading

0 comments on commit 86bce5f

Please sign in to comment.