Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
python-version: ["3.10",]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -30,5 +32,3 @@ jobs:
- name: Check for documentation style errors
working-directory: ./docs
run: ./scripts/doc8_style_check.sh


36 changes: 18 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,21 @@

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', '3.12']
test_suites:
all: |
source venv/bin/activate
pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu22_cpython
image_name: ubuntu-22.04
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
python_versions: ['3.9', '3.10', '3.11', '3.12']
test_suites:
all: |
source venv/bin/activate
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', '3.12']
job_name: ubuntu24_cpython
image_name: ubuntu-24.04
python_versions: ['3.9', '3.10', '3.11', '3.12']
test_suites:
all: |
source venv/bin/activate
Expand All @@ -41,23 +31,33 @@ jobs:
parameters:
job_name: macos13_cpython
image_name: macOS-13
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
python_versions: ['3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos14_cpython_arm64
image_name: macOS-14
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
python_versions: ['3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos15_cpython
image_name: macOS-15
python_versions: ['3.9', '3.10', '3.11', '3.12']
test_suites:
all: |
source venv/bin/activate
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', '3.12']
python_versions: ['3.9', '3.10', '3.11', '3.12']
test_suites:
all: |
call venv\Scripts\activate.bat
Expand All @@ -67,7 +67,7 @@ jobs:
parameters:
job_name: win2022_cpython
image_name: windows-2022
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
python_versions: ['3.9', '3.10', '3.11', '3.12']
test_suites:
all: |
call venv\Scripts\activate.bat
Expand Down
4 changes: 2 additions & 2 deletions docs/source/contribute/contrib_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ Interspinx
ScanCode toolkit documentation uses `Intersphinx <http://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html>`_
to link to other Sphinx Documentations, to maintain links to other Aboutcode Projects.

To link sections in the same documentation, standart reST labels are used. Refer
`Cross-Referencing <http://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#ref-role>`_ for more information.
To link sections in the same documentation, standard reST labels are used. Refer
`Cross-Referencing <http://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html>`_ for more information.

For example::

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[metadata]
name = univers
version = 31.0.0
license = Apache-2.0 AND BSD-3-Clause AND MIT

# description must be on ONE line https://github.com/pypa/setuptools/issues/1390
Expand Down
127 changes: 127 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#
# Copyright (c) nexB Inc. and others.
# SPDX-License-Identifier: Apache-2.0
#
# Visit https://aboutcode.org and https://github.com/aboutcode-org/univers for support and download.

from typing import NamedTuple
from typing import Union


class SchemaDrivenVersTest(NamedTuple):
test_type: str
test_group: str
input: dict
expected_output: Union[list, bool]

@classmethod
def from_data(cls, data: dict):
return cls(**data)

def assert_result(self):
assert self.result == self.expected_output

@property
def result(self):
if self.test_type == "equality":
return self.equality()
elif self.test_type == "comparison":
return self.comparison()
elif self.test_type == "containment":
return self.containment()
elif self.test_type == "roundtrip":
return self.roundtrip()
elif self.test_type == "from_native":
return self.from_native()

raise Exception(f"Unknown test_type: {self.test_type}")

def equality(self):
raise NotImplementedError

def comparison(self):
raise NotImplementedError

def containment(self):
raise NotImplementedError

def roundtrip(self):
raise NotImplementedError

def from_native(self):
raise NotImplementedError

@property
def input_scheme(self):
return self.input["input_scheme"]

@property
def input_native_range(self):
return self.input["native_range"]

@property
def input_version1(self):
return self.input["versions"][0]

@property
def input_version2(self):
return self.input["versions"][1]


def get_test_data_comp(scheme, versions, output):
return {
"test_group": "advanced",
"test_type": "comparison",
"input": {
"input_scheme": scheme,
"versions": versions,
},
"expected_output": output,
}


def get_test_data_eq(scheme, versions, output):
return {
"test_group": "advanced",
"test_type": "equality",
"input": {
"input_scheme": scheme,
"versions": versions,
},
"expected_output": output,
}


def get_test_data_containment(vers, version, output):
return {
"test_group": "advanced",
"test_type": "containment",
"input": {
"vers": vers,
"version": version,
},
"expected_output": output,
}


def get_test_data_roundtrip(vers, output):
return {
"test_group": "advanced",
"test_type": "roundtrip",
"input": {
"vers": vers,
},
"expected_output": output,
}


def get_test_data_from_native(native_range, schema, output):
return {
"test_group": "advanced",
"test_type": "from_native",
"input": {
"native_range": native_range,
"scheme": schema,
},
"expected_output": output,
}
Loading