Skip to content

Commit c050ff2

Browse files
authored
Merge pull request #54 from nexB/update-skeleton
Update-skeleton
2 parents b3193fa + 196fab4 commit c050ff2

25 files changed

+269
-433
lines changed

.github/workflows/docs-ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-22.04
88

99
strategy:
1010
max-parallel: 4
@@ -13,16 +13,13 @@ jobs:
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

23-
- name: Give permission to run scripts
24-
run: chmod +x ./docs/scripts/doc8_style_check.sh
25-
2623
- name: Install Dependencies
2724
run: pip install -e .[docs]
2825

.github/workflows/pypi-release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ on:
2121
jobs:
2222
build-pypi-distribs:
2323
name: Build and publish library to PyPI
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525

2626
steps:
27-
- uses: actions/checkout@master
27+
- uses: actions/checkout@v4
2828
- name: Set up Python
29-
uses: actions/setup-python@v1
29+
uses: actions/setup-python@v4
3030
with:
3131
python-version: 3.9
3232

@@ -47,7 +47,7 @@ jobs:
4747
name: Create GH release
4848
needs:
4949
- build-pypi-distribs
50-
runs-on: ubuntu-20.04
50+
runs-on: ubuntu-22.04
5151

5252
steps:
5353
- name: Download built archives
@@ -67,7 +67,7 @@ jobs:
6767
name: Create PyPI release
6868
needs:
6969
- create-gh-release
70-
runs-on: ubuntu-20.04
70+
runs-on: ubuntu-22.04
7171

7272
steps:
7373
- name: Download built archives
@@ -78,6 +78,6 @@ jobs:
7878

7979
- name: Publish to PyPI
8080
if: startsWith(github.ref, 'refs/tags')
81-
uses: pypa/gh-action-pypi-publish@master
81+
uses: pypa/gh-action-pypi-publish@release/v1
8282
with:
8383
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*.py[cod]
33

44
# virtualenv and other misc bits
5-
/src/*.egg-info
5+
*.egg-info
66
/dist
77
/build
88
/bin

.readthedocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
# Required
66
version: 2
77

8+
# Build in latest ubuntu/python
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
14+
# Build PDF & ePub
15+
formats:
16+
- epub
17+
- pdf
18+
819
# Where the Sphinx conf.py file is located
920
sphinx:
1021
configuration: docs/source/conf.py

Makefile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Copyright (c) nexB Inc. and others. All rights reserved.
4+
# ScanCode is a trademark of nexB Inc.
5+
# SPDX-License-Identifier: Apache-2.0
6+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
7+
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://aboutcode.org for more information about nexB OSS projects.
9+
#
10+
11+
# Python version can be specified with `$ PYTHON_EXE=python3.x make conf`
12+
PYTHON_EXE?=python3
13+
VENV=venv
14+
ACTIVATE?=. ${VENV}/bin/activate;
15+
16+
dev:
17+
@echo "-> Configure the development envt."
18+
./configure --dev
19+
20+
isort:
21+
@echo "-> Apply isort changes to ensure proper imports ordering"
22+
${VENV}/bin/isort --sl -l 100 src tests setup.py
23+
24+
black:
25+
@echo "-> Apply black code formatter"
26+
${VENV}/bin/black -l 100 src tests setup.py
27+
28+
doc8:
29+
@echo "-> Run doc8 validation"
30+
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
31+
32+
valid: isort black
33+
34+
check:
35+
@echo "-> Run pycodestyle (PEP8) validation"
36+
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
37+
@echo "-> Run isort imports ordering validation"
38+
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
39+
@echo "-> Run black validation"
40+
@${ACTIVATE} black --check --check -l 100 src tests setup.py
41+
42+
clean:
43+
@echo "-> Clean the Python env"
44+
./configure --clean
45+
46+
test:
47+
@echo "-> Run the test suite"
48+
${VENV}/bin/pytest -vvs
49+
50+
docs:
51+
rm -rf docs/_build/
52+
@${ACTIVATE} sphinx-build docs/ docs/_build/
53+
54+
.PHONY: conf dev check valid black isort clean test docs

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ for Docker images, containers, root filesystems and virtual machine images.
77

88
For Docker images, it can process layers and how these relate to each other as
99
well as Dockerfiles.
10-
10+
1111
**container-inspector** provides utilities to:
1212

1313
- identify Docker images in a file system, its layers and the related metadata.
@@ -21,7 +21,7 @@ well as Dockerfiles.
2121
(implemented using a provided callable)
2222
- detect the "distro" of a rootfs of image using os-release files (and an
2323
extensive test suite for these)
24-
- detect the operating system, architecture and
24+
- detect the operating system, architecture and
2525

2626

2727
Quick start
@@ -32,12 +32,12 @@ Quick start
3232
- Check out a clone or download of container-inspector, then run: `./configure --dev`.
3333
- Then run `env/bin/container-inspector -h` for help.
3434

35-
35+
3636
Container image formats
3737
-----------------------
3838

3939
container-inspector handles the formats of Docker images as created by the
40-
`docker save` command. There are three versions for this Docker image format.
40+
`docker save` command. There are three versions for this Docker image format.
4141
The latest v1.2 is a minor update to v1.1.
4242

4343
- v1.1 provides improved and richer metadata over v1.0 with a top level manifest.json
@@ -49,13 +49,13 @@ The latest v1.2 is a minor update to v1.1.
4949
format is no longer support in the latest version of container-inspector.
5050

5151
- All V1.x formats use the same storage format for layers e.g the layer format V1.0
52-
where each layer is stored in a sub-directories named after the layer id.
53-
Each of this directories contains a "layer.tar" tarball with the layer payload,
52+
where each layer is stored in a sub-directories named after the layer id.
53+
Each of this directories contains a "layer.tar" tarball with the layer payload,
5454
a "json" JSON metadata file describing the layer and a "VERSION" file describing
5555
the layer format version. Each tarball represents a slice or diff of the image
5656
root file system using the AUFS conventions.
5757

58-
At runtime, in a sequence of layers of an image, each root filesystem slice of a
58+
At runtime, in a sequence of layers of an image, each root filesystem slice of a
5959
layer is "layered" on top of each other from the root bottom layer to the latest
6060
layer (or selected tagged layer) using a union file system (e.g. AUFS).
6161
In AUFS, any file or directory prefixed with .wh. are "white outs" files deleting

azure-pipelines.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,49 @@ jobs:
99

1010
- template: etc/ci/azure-posix.yml
1111
parameters:
12-
job_name: ubuntu18_cpython
13-
image_name: ubuntu-18.04
14-
python_versions: ['3.7', '3.8', '3.9', '3.10']
12+
job_name: ubuntu20_cpython
13+
image_name: ubuntu-20.04
14+
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
1515
test_suites:
1616
all: venv/bin/pytest -n 2 -vvs
1717

1818
- template: etc/ci/azure-posix.yml
1919
parameters:
20-
job_name: ubuntu20_cpython
21-
image_name: ubuntu-20.04
22-
python_versions: ['3.7', '3.8', '3.9', '3.10']
20+
job_name: ubuntu22_cpython
21+
image_name: ubuntu-22.04
22+
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
2323
test_suites:
2424
all: venv/bin/pytest -n 2 -vvs
2525

2626
- template: etc/ci/azure-posix.yml
2727
parameters:
28-
job_name: macos1015_cpython
29-
image_name: macos-10.15
30-
python_versions: ['3.7', '3.8', '3.9', '3.10']
28+
job_name: macos11_cpython
29+
image_name: macOS-11
30+
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
3131
test_suites:
3232
all: venv/bin/pytest -n 2 -vvs
3333

3434
- template: etc/ci/azure-posix.yml
3535
parameters:
36-
job_name: macos11_cpython
37-
image_name: macos-11
38-
python_versions: ['3.7', '3.8', '3.9', '3.10']
36+
job_name: macos12_cpython
37+
image_name: macOS-12
38+
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
39+
test_suites:
40+
all: venv/bin/pytest -n 2 -vvs
41+
42+
- template: etc/ci/azure-posix.yml
43+
parameters:
44+
job_name: macos13_cpython
45+
image_name: macOS-13
46+
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
47+
test_suites:
48+
all: venv/bin/pytest -n 2 -vvs
49+
50+
- template: etc/ci/azure-posix.yml
51+
parameters:
52+
job_name: macos14_cpython
53+
image_name: macOS-14
54+
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
3955
test_suites:
4056
all: venv/bin/pytest -n 2 -vvs
4157

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ DOCS_REQUIREMENTS="--editable .[docs] --constraint requirements.txt"
3636
VIRTUALENV_DIR=venv
3737

3838
# Cleanable files and directories to delete with the --clean option
39-
CLEANABLE="build venv"
39+
CLEANABLE="build dist venv .cache .eggs"
4040

4141
# extra arguments passed to pip
4242
PIP_EXTRA_ARGS=" "

configure.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ set "DOCS_REQUIREMENTS=--editable .[docs] --constraint requirements.txt"
3434
set "VIRTUALENV_DIR=venv"
3535

3636
@rem # Cleanable files and directories to delete with the --clean option
37-
set "CLEANABLE=build venv"
37+
set "CLEANABLE=build dist venv .cache .eggs"
3838

3939
@rem # extra arguments passed to pip
4040
set "PIP_EXTRA_ARGS= "

docs/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# from the environment for the first two.
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
8+
SPHINXAUTOBUILD = sphinx-autobuild
89
SOURCEDIR = source
910
BUILDDIR = build
1011

@@ -14,6 +15,13 @@ help:
1415

1516
.PHONY: help Makefile
1617

18+
# Run the development server using sphinx-autobuild
19+
docs:
20+
@echo
21+
@echo "Starting up the docs server..."
22+
@echo
23+
$(SPHINXAUTOBUILD) --port 8000 --watch ${SOURCEDIR} $(SOURCEDIR) "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
24+
1725
# Catch-all target: route all unknown targets to Sphinx using the new
1826
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1927
%: Makefile

0 commit comments

Comments
 (0)