Skip to content

Merge latest skeleton changes #72

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,29 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

strategy:
max-parallel: 4
matrix:
python-version: [3.9]
python-version: [3.12]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Give permission to run scripts
run: chmod +x ./docs/scripts/doc8_style_check.sh

- name: Install Dependencies
run: pip install -e .[docs]
run: ./configure --dev

- name: Check Sphinx Documentation build minimally
working-directory: ./docs
run: sphinx-build -E -W source build
- name: Check documentation and HTML for errors and dead links
run: make docs-check

- name: Check for documentation style errors
working-directory: ./docs
run: ./scripts/doc8_style_check.sh
- name: Check documentation for style errors
run: make doc8


27 changes: 15 additions & 12 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,26 @@ on:
jobs:
build-pypi-distribs:
name: Build and publish library to PyPI
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12

- name: Install pypa/build
run: python -m pip install build --user
- name: Install pypa/build and twine
run: python -m pip install --user build twine

- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/

- name: Validate wheel and sdis for Pypi
run: python -m twine check dist/*

- name: Upload built archives
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pypi_archives
path: dist/*
Expand All @@ -47,17 +50,17 @@ jobs:
name: Create GH release
needs:
- build-pypi-distribs
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Download built archives
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: pypi_archives
path: dist

- name: Create GH release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
files: dist/*
Expand All @@ -67,11 +70,11 @@ jobs:
name: Create PyPI release
needs:
- create-gh-release
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Download built archives
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: pypi_archives
path: dist
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ tcl

# Ignore Jupyter Notebook related temp files
.ipynb_checkpoints/
/.ruff_cache/
.env
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ python:
- method: pip
path: .
extra_requirements:
- docs
- dev
3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ The following organizations or individuals have contributed to this repo:
- Qingmin Duanmu @qduanmu
- Rakesh Balusa @balusarakesh
- Ravi Jain @JRavi2
- Steven Esser @majurg
- Steven Esser @majurg

13 changes: 11 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
graft src
graft docs
graft etc

include *.LICENSE
include NOTICE
include *.ABOUT
include *.toml
include *.yml
include *.rst
include *.png
include setup.*
include configure*
include requirements*
include .giti*
include .dockerignore
include .gitignore
include .readthedocs.yml
include manage.py
include Dockerfile*
include Makefile
include MANIFEST.in

include extractcode*
include .VERSION

global-exclude *.py[co] __pycache__ *.*~

46 changes: 26 additions & 20 deletions 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/skeleton for support or download.
# See https://github.com/aboutcode-org/skeleton for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#

Expand All @@ -13,31 +13,33 @@ PYTHON_EXE?=python3
VENV=venv
ACTIVATE?=. ${VENV}/bin/activate;

dev:
@echo "-> Configure the development envt."
./configure --dev

isort:
@echo "-> Apply isort changes to ensure proper imports ordering"
${VENV}/bin/isort --sl -l 100 src tests setup.py
conf:
@echo "-> Install dependencies"
./configure

black:
@echo "-> Apply black code formatter"
${VENV}/bin/black -l 100 src tests setup.py
dev:
@echo "-> Configure and install development dependencies"
./configure --dev

doc8:
@echo "-> Run doc8 validation"
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
@${ACTIVATE} doc8 --quiet docs/ *.rst

valid: isort black
valid:
@echo "-> Run Ruff format"
@${ACTIVATE} ruff format
@echo "-> Run Ruff linter"
@${ACTIVATE} ruff check --fix

check:
@echo "-> Run pycodestyle (PEP8) validation"
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
@echo "-> Run isort imports ordering validation"
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
@echo "-> Run black validation"
@${ACTIVATE} black --check --check -l 100 src tests setup.py
@echo "-> Run Ruff linter validation (pycodestyle, bandit, isort, and more)"
@${ACTIVATE} ruff check
@echo "-> Run Ruff format validation"
@${ACTIVATE} ruff format --check
@$(MAKE) doc8
@echo "-> Run ABOUT files validation"
@${ACTIVATE} about check etc/

clean:
@echo "-> Clean the Python env"
Expand All @@ -49,6 +51,10 @@ test:

docs:
rm -rf docs/_build/
@${ACTIVATE} sphinx-build docs/ docs/_build/
@${ACTIVATE} sphinx-build docs/source docs/_build/

docs-check:
@${ACTIVATE} sphinx-build -E -W -b html docs/source docs/_build/
@${ACTIVATE} sphinx-build -E -W -b linkcheck docs/source docs/_build/

.PHONY: conf dev check valid black isort clean test docs
.PHONY: conf dev check valid clean test docs docs-check
5 changes: 2 additions & 3 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
# 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/extractcode for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
# Visit https://aboutcode.org and https://github.com/aboutcode-org/ for support and download.
#
20 changes: 10 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ExtractCode

- license: Apache-2.0
- copyright: copyright (c) nexB. Inc. and others
- homepage_url: https://github.com/nexB/extractcode
- homepage_url: https://github.com/aboutcode-org/extractcode
- keywords: archive, extraction, libarchive, 7zip, scancode-toolkit, extractcode

Supports Windows, Linux and macOS on 64 bits processors and Python 3.6 to 3.9.
Expand Down Expand Up @@ -83,12 +83,12 @@ libmagic) to select the most appropriate extractor or decompressor function.
It can handle multi-level archives such as tar.gz and can extract recursively
any nested archives.

Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
Visit https://aboutcode.org and https://github.com/aboutcode-org/ for support and download.


We run CI tests on:

- Azure pipelines https://dev.azure.com/nexB/extractcode/_build
- Azure pipelines https://dev.azure.com/aboutcode-org/extractcode/_build


Installation
Expand All @@ -109,7 +109,7 @@ In this case, you will need to provide a working and compatible libarchive and
find them:

- **a typecode-libarchive and typecode-7z plugin**: See the standard ones at
https://github.com/nexB/scancode-plugins/tree/main/builtins
https://github.com/aboutcode-org/scancode-plugins/tree/main/builtins
These can either bundle a libarchive library, a 7z executable or expose a
system-installed libraries.
It does so by providing plugin entry points as ``scancode_location_provider``
Expand All @@ -121,8 +121,8 @@ find them:

See for example:

- https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_libarchive-linux/setup.py#L40
- https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_libarchive-linux/src/extractcode_libarchive/__init__.py#L17
- https://github.com/aboutcode-org/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_libarchive-linux/setup.py#L40
- https://github.com/aboutcode-org/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_libarchive-linux/src/extractcode_libarchive/__init__.py#L17

And in the same way, the ``scancode_location_provider`` for ``extractcode_7zip``
should point to a ``LocationProviderPlugin`` subclass with a ``get_locations()``
Expand All @@ -132,8 +132,8 @@ find them:

See for example:

- https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_7z-linux/setup.py#L40
- https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_7z-linux/src/extractcode_7z/__init__.py#L18
- https://github.com/aboutcode-org/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_7z-linux/setup.py#L40
- https://github.com/aboutcode-org/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_7z-linux/src/extractcode_7z/__init__.py#L18

- use **environment variables** to point to installed binaries:

Expand Down Expand Up @@ -181,14 +181,14 @@ ExtractCode will use these environment variables if set:
- EXTRACTCODE_LIBARCHIVE_PATH : the path to the ``libarchive.so`` libarchive
shared library used to support some of the archive formats. If not provided,
ExtractCode will look for a plugin-provided libarchive library path. See
https://github.com/nexB/scancode-plugins/tree/main/builtins for such plugins.
https://github.com/aboutcode-org/scancode-plugins/tree/main/builtins for such plugins.
If no plugin contributes libarchive, then a final attempt is made to look for
it in the PATH using standard DLL loading techniques.

- EXTRACTCODE_7Z_PATH : the path to the ``7z`` 7zip executable used to support
some of the archive formats. If not provided, ExtractCode will look for a
plugin-provided 7z executable path. See
https://github.com/nexB/scancode-plugins/tree/main/builtins for such plugins.
https://github.com/aboutcode-org/scancode-plugins/tree/main/builtins for such plugins.
If no plugin contributes 7z, then a final attempt is made to look for
it in the PATH.

Expand Down
20 changes: 10 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
jobs:
- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ["3.8", "3.9", "3.10", "3.11"]
job_name: ubuntu24_cpython
image_name: ubuntu-24.04
python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"]
test_suites:
all:
sudo chmod 0644 /boot/vmlinuz-* && sudo apt install libguestfs-tools
Expand All @@ -19,38 +19,38 @@ jobs:
parameters:
job_name: ubuntu22_cpython
image_name: ubuntu-22.04
python_versions: ["3.8", "3.9", "3.10", "3.11"]
python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"]
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython
image_name: macos-12
python_versions: ["3.8", "3.9", "3.10", "3.11"]
job_name: macos14_cpython
image_name: macos-14
python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"]
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos13_cpython
image_name: macos-13
python_versions: ["3.8", "3.9", "3.10", "3.11"]
python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"]
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ["3.8", "3.9", "3.10", "3.11"]
python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"]
test_suites:
all: venv\Scripts\pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2022_cpython
image_name: windows-2022
python_versions: ["3.8", "3.9", "3.10", "3.11"]
python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"]
test_suites:
all: venv\Scripts\pytest -n 2 -vvs
Loading
Loading