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
39 changes: 20 additions & 19 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ body:
- type: markdown
attributes:
value: "
Thanks for taking the time to fill out this bug report!
Thanks for taking the time to fill out this bug report!


Before submitting, make sure you search in the [issue list](https://github.com/BlueBrain/dir-content-diff/issues) that a similar issue was not already reported.
If it is not the case, please read the following guidelines.
Before submitting, make sure you search in the [issue list](https://github.com/BlueBrain/dir-content-diff/issues) that a similar issue was not already reported.
If it is not the case, please read the following guidelines.

### GUIDELINES FOR REPORTING BUGS
### GUIDELINES FOR REPORTING BUGS

Bug reports that are not properly formulated and formatted or without enough details can be very hard for us to understand and fix.
In order to ensure we can help you fixing your bug, please follow these guidelines.
Bug reports that are not properly formulated and formatted or without enough details can be very hard for us to understand and fix.
In order to ensure we can help you fixing your bug, please follow these guidelines.


Your reports must include the following features:
Your reports must include the following features:

1. **succinct description** of the problem - typically a line or two at most.
1. **succinct description** of the problem - typically a line or two at most.

2. **succinct, dependency-free code** which reproduces the problem, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example.
IF YOU DO NOT HAVE A COMPLETE, RUNNABLE TEST CASE WRITTEN DIRECTLY IN THE TEXTAREA BELOW, YOUR ISSUE MAY BE CLOSED.
2. **succinct, dependency-free code** which reproduces the problem, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example.
IF YOU DO NOT HAVE A COMPLETE, RUNNABLE TEST CASE WRITTEN DIRECTLY IN THE TEXTAREA BELOW, YOUR ISSUE MAY BE CLOSED.

3. **complete stack traces for all errors** - please avoid screenshots, use formatted text inside issues.
3. **complete stack traces for all errors** - please avoid screenshots, use formatted text inside issues.

4. other relevant things as applicable: **dependencies**, **comparative performance timings** for performance issues, etc.
"
4. other relevant things as applicable: **dependencies**, **comparative performance timings** for performance issues, etc.
"

- type: textarea
attributes:
Expand All @@ -45,16 +45,17 @@ Your reports must include the following features:
attributes:
label: Optional link from https://dir-content-diff.readthedocs.io which documents the behavior that is expected
description: "
Please make sure the behavior you are seeing is definitely in contradiction to what's documented as the correct behavior.
"
Please make sure the behavior you are seeing is definitely in contradiction to what's documented as the correct behavior.
"
validations:
required: false

- type: textarea
attributes:
label: To Reproduce
description: "
Provide your [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example here."
Provide your [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example here.
"
placeholder: "# Insert code here (text area already python formatted)"
render: Python
validations:
Expand All @@ -64,9 +65,9 @@ Provide your [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/
attributes:
label: Error
description: "
Provide the complete text of any errors received **including the complete stack trace**.
If the message is a warning, run your program with the ``-Werror`` flag: ``python -Werror myprogram.py``
"
Provide the complete text of any errors received **including the complete stack trace**.
If the message is a warning, run your program with the ``-Werror`` flag: ``python -Werror myprogram.py``
"
placeholder: "# Copy the complete stack trace and error message here (text area already formatted for Python backtrace)"
render: Python traceback
validations:
Expand Down
22 changes: 11 additions & 11 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ body:
- type: markdown
attributes:
value: "
Thanks for taking the time to fill out this feature request!
Thanks for taking the time to fill out this feature request!


Before submitting, make sure the feature does not already exist in the [documentation](https://dir-content-diff.readthedocs.io) and that you searched in the [issue list](https://github.com/BlueBrain/dir-content-diff/issues) that a similar feature request has not already been reported.
If it is not the case, please read the following guidelines.
Before submitting, make sure the feature does not already exist in the [documentation](https://dir-content-diff.readthedocs.io) and that you searched in the [issue list](https://github.com/BlueBrain/dir-content-diff/issues) that a similar feature request has not already been reported.
If it is not the case, please read the following guidelines.

### GUIDELINES FOR REQUESTING HELP
### GUIDELINES FOR REQUESTING HELP

Feature requests that are not properly formulated and formatted or without enough details can be very hard for us to understand.
In order to ensure we can help you, please follow these guidelines.
Feature requests that are not properly formulated and formatted or without enough details can be very hard for us to understand.
In order to ensure we can help you, please follow these guidelines.


Your requests must include the following features:
Your requests must include the following features:

1. **succinct description** of the feature - typically a line or two at most to describe what the new feature would do.
1. **succinct description** of the feature - typically a line or two at most to describe what the new feature would do.

2. **succinct, dependency-free code** which shows how you would like to use this feature, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example.
2. **succinct, dependency-free code** which shows how you would like to use this feature, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example.

3. Why do you need this feature? What would be the use cases?
"
3. Why do you need this feature? What would be the use cases?
"

- type: textarea
attributes:
Expand Down
37 changes: 19 additions & 18 deletions .github/ISSUE_TEMPLATE/how_to_use.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ body:
- type: markdown
attributes:
value: "
Thanks for using this package and taking the time to fill out this help request!
Thanks for using this package and taking the time to fill out this help request!


Before submitting, make sure you read the [documentation](https://dir-content-diff.readthedocs.io) carefully.
If you still have a question, you should search in the [issue list](https://github.com/BlueBrain/dir-content-diff/issues) that a similar issue has not already been reported, you might find your answer there.
If it is not the case, please read the following guidelines.
Before submitting, make sure you read the [documentation](https://dir-content-diff.readthedocs.io) carefully.
If you still have a question, you should search in the [issue list](https://github.com/BlueBrain/dir-content-diff/issues) that a similar issue has not already been reported, you might find your answer there.
If it is not the case, please read the following guidelines.

### GUIDELINES FOR REQUESTING HELP
### GUIDELINES FOR REQUESTING HELP

Questions that are not properly formulated and formatted or without enough details can be very hard for us to understand.
In order to ensure we can help you, please follow these guidelines.
Questions that are not properly formulated and formatted or without enough details can be very hard for us to understand.
In order to ensure we can help you, please follow these guidelines.


Your requests must include the following features:
Your requests must include the following features:

1. **succinct description** of the problem - typically a line or two at most to describe what you want to achieve.
1. **succinct description** of the problem - typically a line or two at most to describe what you want to achieve.

2. **succinct, dependency-free code** which shows what you tried to do, otherwise known as a [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve).
2. **succinct, dependency-free code** which shows what you tried to do, otherwise known as a [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve).

3. **expected results**
3. **expected results**

4. **complete stack traces for all errors** if you have any - please avoid screenshots, use formatted text inside issues.
4. **complete stack traces for all errors** if you have any - please avoid screenshots, use formatted text inside issues.

5. other relevant things: **dependencies**, **operating system**, **comparative performance timings** for performance issues.
"
5. other relevant things: **dependencies**, **operating system**, **comparative performance timings** for performance issues.
"

- type: textarea
attributes:
Expand All @@ -46,7 +46,8 @@ Your requests must include the following features:
attributes:
label: Show what you tried to do.
description: "
Provide your [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve) here."
Provide your [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve) here.
"
placeholder: "# Insert code here (text area already python formatted)"
render: Python
validations:
Expand All @@ -63,9 +64,9 @@ Provide your [Minimal, Complete, and Verifiable Example](https://stackoverflow.c
attributes:
label: Error
description: "
If you are facing an arror, provide the complete text of any errors received **including the complete stack trace**.
If the message is a warning, run your program with the ``-Werror`` flag: ``python -Werror myprogram.py``
"
If you are facing an arror, provide the complete text of any errors received **including the complete stack trace**.
If the message is a warning, run your program with the ``-Werror`` flag: ``python -Werror myprogram.py``
"
placeholder: "# Copy the complete stack trace and error message here (text area already formatted for Python backtrace)"
render: Python traceback
validations:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
env:
PR_TITLE: ${{ github.event.pull_request.title }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: '20'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Build and publish on PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/run-tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
min_versions: ["min_versions", "latest_versions"]
exclude:
- min_versions: "min_versions"
include:
- python-version: "3.9"
- python-version: "3.10"
min_versions: "min_versions"

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
Expand All @@ -35,27 +35,27 @@ jobs:
- name: Install APT Packages
run: |
sudo apt-get install -y poppler-utils imagemagick
- name: Cache tox and precommit environments
- name: Cache tox and prek environments
uses: actions/cache@v5
with:
path: |
.tox
~/.cache/pre-commit
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.date.outputs.date }}-${{ hashFiles('setup.py') }}-${{ hashFiles('.pre-commit-config.yaml') }}
~/.cache/prek
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.date.outputs.date }}-${{ hashFiles('setup.py', 'pyproject.toml', 'tox.ini', 'dir_content_diff/comparators/dependencies.json', '.pre-commit-config.yaml') }}
- name: Clear results in tox environments
run: |
rm -rf .tox/*/tmp
- name: Run tox with latest versions
if: ${{ matrix.min_versions == 'latest_versions' }}
run: |
python -m pip install --upgrade pip setuptools
pip install tox-gh-actions
pip install tox-uv tox-gh-actions
tox
- name: Run tox with min versions
if: ${{ matrix.min_versions == 'min_versions' }}
run: |
python -m pip install --upgrade pip setuptools
pip install tox
pip install tox-uv
tox run -e min_versions
- name: JUnit Report Action
uses: mikepenz/action-junit-report@v6
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
default_install_hook_types:
- pre-commit
- commit-msg

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ When you wish to contribute to the code base, please consider the following guid
or

```shell
tox run -e py39,lint,docs,check-packaging
tox run -e py310,lint,docs,check-packaging
```

* Commit your changes using a descriptive commit message.
Expand Down
2 changes: 1 addition & 1 deletion dir_content_diff/comparators/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"tables>=3.7"
],
"morphio": ["morphio>=3.3.6", "morph_tool>=2.9"],
"voxcell": ["voxcell>=3.1.1", "pynrrd>=0.4,<1.1"]
"voxcell": ["voxcell>=3.1.1", "pynrrd>=0.4,<1.1", "nptyping>=2.5"]
}
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ authors = [
]
description = "Simple tool to compare directory contents."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
license = { text = "Apache License 2.0" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down Expand Up @@ -57,7 +56,6 @@ include = ["dir_content_diff*"]
[tool.black]
line-length = 100
target-version = [
"py39",
"py310",
"py311",
"py312",
Expand Down
13 changes: 6 additions & 7 deletions tests/test_missing_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,35 @@
# LICENSE HEADER MANAGED BY add-license-header

import importlib
import sys
from subprocess import run

import pytest

import dir_content_diff.comparators


@pytest.mark.comparators_missing_deps
def test_missing_deps(tmp_path):
"""Test missing dependencies."""
root_dir = importlib.resources.files("dir_content_diff") # pylint: disable=no-member
comparator_dir = root_dir / "comparators"
imported_comparators = [
f"import dir_content_diff.comparators.{i}\n"
for i in dir(dir_content_diff.comparators)
if "_" not in i and (comparator_dir / i).with_suffix(".py").exists()
f"import dir_content_diff.comparators.{path.stem}\n"
for path in sorted(comparator_dir.glob("*.py"))
]
missing_deps_file = tmp_path / "test_missing_deps.py"
with missing_deps_file.open(mode="w", encoding="utf8") as f:
f.writelines(imported_comparators)
f.flush()
res = run(["python", str(missing_deps_file)], capture_output=True, check=True)
res = run([sys.executable, str(missing_deps_file)], capture_output=True, check=True)
assert res.stderr.decode() == (
"Loading the morphio module without the required dependencies installed "
"(requirements are the following: morphio>=3.3.6 and morph_tool>=2.9). "
"Will crash at runtime if the related functionalities are used. "
"These dependencies can be installed with 'pip install dir-content-diff[morphio]'."
"\n"
"Loading the voxcell module without the required dependencies installed "
"(requirement is the following: voxcell>=3.1.1). "
"(requirements are the following: voxcell>=3.1.1, pynrrd<1.1,>=0.4 and "
"nptyping>=2.5). "
"Will crash at runtime if the related functionalities are used. "
"These dependencies can be installed with 'pip install dir-content-diff[voxcell]'.\n"
)
10 changes: 5 additions & 5 deletions tests/test_parallel_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ def test_parallel_single_file_fallback(
generate_test_files.create_json(empty_res_tree / "file.json")

# Mock the parallel executors and configure logs
with patch(
"concurrent.futures.ThreadPoolExecutor"
) as mock_thread_executor, patch(
"concurrent.futures.ProcessPoolExecutor"
) as mock_process_executor, caplog.at_level(logging.DEBUG):
with (
patch("concurrent.futures.ThreadPoolExecutor") as mock_thread_executor,
patch("concurrent.futures.ProcessPoolExecutor") as mock_process_executor,
caplog.at_level(logging.DEBUG),
):
result = compare_trees(
empty_ref_tree, empty_res_tree, executor_type="thread", max_workers=4
)
Expand Down
Loading
Loading