Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
154144b
Enable automatic release on tag
pombredanne May 12, 2022
1165f12
Remove Travis config
pombredanne May 25, 2022
c1f70fc
Add ScanCode Code of Conduct
pombredanne May 27, 2022
9acab17
Improve detection of thirdparty dir
pombredanne May 27, 2022
4dc2521
Add comment
pombredanne May 29, 2022
04a872c
Remove the thirdparty directory
chinyeungli Sep 22, 2022
07cd736
Update the azure-piprlines
chinyeungli Sep 22, 2022
509b032
Add missing os import in utils_requirements.py
JonoYang Oct 18, 2022
c6bba07
Reinstate Ubuntu 18 and drop Python 3.6 and 3.7
pombredanne Nov 25, 2022
bec5391
Merge pull request #68 from nexB/remove_thirdparty_and_update_ci
pombredanne Nov 25, 2022
1bd7a2f
Replace packaging with packvers
swastkk Jan 5, 2023
5be2690
Merge pull request #71 from swastkk/packvers-added
pombredanne Jan 12, 2023
6f21d2b
Ignore egginfo
pombredanne Jan 15, 2023
f841c2f
Drop Python 3.7 add Python 3.11
pombredanne Jan 15, 2023
bd2a464
Clean .cache and .eggs
pombredanne Jan 15, 2023
6270a88
Add COC to redistributed license-like files
pombredanne Jan 15, 2023
d3a19bd
Add new Makefile
pombredanne Jan 15, 2023
91f5613
Align scripts with latest ScanCode Toolkit
pombredanne Jan 15, 2023
1205bc0
Merge latest main branch
pombredanne Jan 15, 2023
d661e13
Add pycodestyle in setup.cfg
arnav-mandal1234 Mar 24, 2023
e985492
Remove deprecated github-actions/azure images
AyanSinhaMahapatra Mar 28, 2023
3349130
Merge pull request #73 from nexB/update-ci-images
AyanSinhaMahapatra Mar 29, 2023
c5d4e62
Merge pull request #72 from arnav-mandal1234/pycodestyle
JonoYang Apr 17, 2023
7e35445
Pin Sphinx version to 6.2.1
JonoYang May 8, 2023
8d205ef
Merge pull request #74 from nexB/pin-sphinx
JonoYang May 8, 2023
e3aaf63
Publish PDF version of RTD documentation
arijitde92 May 31, 2023
5072e43
Merge pull request #76 from arijitde92/pdf_rtd_doc
AyanSinhaMahapatra Jun 1, 2023
5be7a24
Bump github actions versions #75
AyanSinhaMahapatra Jun 6, 2023
30f3f02
Merge pull request #78 from nexB/update-github-actions
AyanSinhaMahapatra Jun 6, 2023
78a64e5
Update github actions
AyanSinhaMahapatra Jul 10, 2023
a4d8628
Update RTD buil
AyanSinhaMahapatra Jul 10, 2023
4c68fba
Fix unordered lists issue
AyanSinhaMahapatra Jul 10, 2023
c33241d
Add redirects for docs
AyanSinhaMahapatra May 25, 2023
7a22968
Merge pull request #79 from nexB/doc-and-ci-updates
AyanSinhaMahapatra Jul 12, 2023
df76984
Add `ignored_resources` attribute in ABOUT file
AyanSinhaMahapatra Jul 13, 2023
0193da2
Merge remote-tracking branch 'skeleton/main' into add-ignored-resources
AyanSinhaMahapatra Jul 13, 2023
ba52e20
Add docs for ignored_resources
AyanSinhaMahapatra Jul 14, 2023
65e1bda
Update spec version and CHANGELOG
AyanSinhaMahapatra Jul 14, 2023
27bac99
Merge branch 'develop' into add-ignored-resources
AyanSinhaMahapatra Jul 14, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

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

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

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
runs-on: ubuntu-20.04

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

Expand Down Expand Up @@ -78,6 +78,6 @@ jobs:

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
11 changes: 11 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
# Required
version: 2

# Build in latest ubuntu/python
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build PDF & ePub
formats:
- epub
- pdf

# Where the Sphinx conf.py file is located
sphinx:
configuration: docs/source/conf.py
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
==============================
Changelog

2023-xx-xx
Release x.x.x

* The tool will now show which worksheet (if .xlsx input) is the tool working on
* Error handling if defined worksheet does not exist
* Adopt 3.3.1 specification: introduce ``ignored_resources``


2023-03-09
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In addition, this tool is able to generate attribution notices and
identify redistributable source code used in your project to help you comply
with open source licenses conditions.

This version of the AboutCode Toolkit follows the ABOUT specification version 3.3.0 at:
This version of the AboutCode Toolkit follows the ABOUT specification version 3.3.1 at:
https://aboutcode-toolkit.readthedocs.io/en/latest/specification.html


Expand Down
16 changes: 0 additions & 16 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

jobs:

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu18_cpython
image_name: ubuntu-18.04
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython
Expand All @@ -31,14 +23,6 @@ jobs:
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos1015_cpython_2
image_name: macos-10.15
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos11_cpython
Expand Down
50 changes: 46 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,25 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.intersphinx',
"sphinx.ext.intersphinx",
"sphinx_reredirects",
]


# Redirects for olds pages
# See https://documatt.gitlab.io/sphinx-reredirects/usage.html
redirects = {}

# This points to aboutcode.readthedocs.io
# In case of "undefined label" ERRORS check docs on intersphinx to troubleshoot
# Link was created at commit - https://github.com/nexB/aboutcode/commit/faea9fcf3248f8f198844fe34d43833224ac4a83

intersphinx_mapping = {
"aboutcode": ("https://aboutcode.readthedocs.io/en/latest/", None),
"scancode-workbench": ("https://scancode-workbench.readthedocs.io/en/develop/", None),
}


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -61,6 +77,32 @@
"conf_py_path": "/docs/source/", # path in the checkout to the docs root
}

html_css_files = [
'_static/theme_overrides.css'
]
html_css_files = ["_static/theme_overrides.css"]


# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
html_show_sphinx = True

# Define CSS and HTML abbreviations used in .rst files. These are examples.
# .. role:: is used to refer to styles defined in _static/theme_overrides.css and is used like this: :red:`text`
rst_prolog = """
.. |psf| replace:: Python Software Foundation

.. # define a hard line break for HTML
.. |br| raw:: html

<br />

.. role:: red

.. role:: img-title

.. role:: img-title-para

"""

# -- Options for LaTeX output -------------------------------------------------

latex_elements = {
'classoptions': ',openany,oneside'
}
3 changes: 3 additions & 0 deletions docs/source/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ it will copy and store next to the .ABOUT files.
* - name
- Component name
- Mandatory
* - ignored_resources
- List of paths ignored from the ``about_resource``
- Optional
* - version
- Component version
- Optional
Expand Down
2 changes: 1 addition & 1 deletion docs/source/home.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In addition, this tool is able to generate attribution notices and
identify redistributable source code used in your project to help you comply
with open source licenses conditions.

This version of the AboutCode Toolkit follows the ABOUT specification version 3.3.0 at:
This version of the AboutCode Toolkit follows the ABOUT specification version 3.3.1 at:
https://aboutcode-toolkit.readthedocs.io/en/latest/specification.html


Expand Down
24 changes: 19 additions & 5 deletions docs/source/specification.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _specification:

===============================
ABOUT File Specification v3.3.0
ABOUT File Specification v3.3.1
===============================

Purpose
Expand Down Expand Up @@ -218,11 +218,14 @@ in any case combination.
Referencing the file or directory documented by an ABOUT file
-------------------------------------------------------------

An ABOUT file documents one file or directory. The mandatory "about_resource"
field reference the documented file or directory. The value of the "about_resource"
field is the name or path of the referenced file or directory.
An ABOUT file documents one file or directory. The mandatory ``about_resource``
field reference the documented file or directory. The value of the ``about_resource``
field is the name or path of the referenced file or directory. There is also a
``ignored_resources`` field which can be used to ignore a set of subpaths inside the
directory which is being documented in the ABOUT file.

A tool processing an ABOUT file must report an error if this field is missing.
A tool processing an ABOUT file must report an error if the ``about_resource``
field is missing.

By convention, an ABOUT file is often stored in the same directory side-by-side
to the file or directory that it documents, but this is not mandatory.
Expand All @@ -240,6 +243,14 @@ In this example, the ABOUT file documents a whole sub-directory:

about_resource: linux-kernel-2.6.23

In this example, the ABOUT file documents a whole sub-directory, with some
sub-paths under the directory ignored:

.. code-block:: none

about_resource: linux-kernel-2.6.23
ignored_resources: linux-kernel-2.6.23/Documentation

In this example, the ABOUT file documents the current directory, using a "." period to reference it:

.. code-block:: none
Expand All @@ -258,6 +269,9 @@ mandatory field are missing.
Optional Information fields
---------------------------

- ignored_resources: A list of paths under the ``about_resource`` path, which are
not documented in the ABOUT file, and the information in the ABOUT file does not
apply to these subpaths.
- version: Component or package version. A component or package usually has a version,
such as a revision number or hash from a version control system (for a snapshot checked
out from VCS such as Subversion or Git). If not available, the version should be the date
Expand Down
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ testing =
isort

docs =
Sphinx >= 3.3.1
sphinx-rtd-theme >= 0.5.0
doc8 >= 0.8.1
Sphinx>=5.0.2
sphinx-rtd-theme>=1.0.0
sphinx-reredirects >= 0.1.2
doc8>=0.11.2

[options.entry_points]
console_scripts =
Expand Down
2 changes: 1 addition & 1 deletion src/attributecode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

__version__ = '8.0.0'

__about_spec_version__ = '3.3.0'
__about_spec_version__ = '3.3.1'

__copyright__ = """
Copyright (c) nexB Inc. All rights reserved. http://dejacode.org
Expand Down
17 changes: 17 additions & 0 deletions src/attributecode/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,22 @@ def _validate(self, *args, **kwargs):
return errors


class IgnoredResourcesField(PathField):
"""
Special field for ignored_resources. self.ignored_paths contains a list of
path patterns (glob patterns) which are not part of the summarization provided
by the ABOUT file.
"""

def __init__(self, *args, ** kwargs):
super(AboutResourceField, self).__init__(*args, ** kwargs)
self.resolved_paths = []

def _validate(self, *args, **kwargs):
errors = super(AboutResourceField, self)._validate(*args, ** kwargs)
return errors


class FileTextField(PathField):
"""
A path field pointing to one or more text files such as license files.
Expand Down Expand Up @@ -764,6 +780,7 @@ def set_standard_fields(self):
"""
self.fields = dict([
('about_resource', AboutResourceField(required=True)),
('ignored_resources', AboutResourceField()),
('name', SingleLineField(required=True)),
('version', SingleLineField()),

Expand Down
11 changes: 11 additions & 0 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,17 @@ def test_About_with_existing_about_resource_has_no_error(self):
# this means we have a location
self.assertNotEqual([], result)

def test_About_loads_ignored_resources_field(self):
# fields in this file are not in the standard order
test_file = get_test_loc('test_model/parse/with_ignored_resources.ABOUT')
a = model.About(test_file)
#assert [] == a.errors

expected = ['about_resource', 'ignored_resources', 'name']
result = [f.name for f in a.all_fields() if f.present]
assert expected == result


def test_About_has_errors_when_about_resource_is_missing(self):
test_file = get_test_loc('test_gen/parser_tests/.ABOUT')
a = model.About(test_file)
Expand Down
5 changes: 5 additions & 0 deletions tests/testdata/test_model/parse/with_ignored_resources.ABOUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: elasticsearch-sidecar
about_resource: elasticsearch-sidecar
ignored_resources:
- elasticsearch-sidecar/plugins/
- elasticsearch-sidecar/logs/