Skip to content
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

Use Burocrata to check/add license notices #23

Merged
merged 1 commit into from
Mar 1, 2024
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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ test:
format:
isort $(CHECK_STYLE)
black $(CHECK_STYLE)
burocrata --extension=py $(CHECK_STYLE)

check: check-format check-style

Expand All @@ -40,6 +41,7 @@ check-style:
check-format:
isort --check $(CHECK_STYLE)
black --check $(CHECK_STYLE)
burocrata --check --extension=py $(CHECK_STYLE)

clean:
find . -name "*.pyc" -exec rm -v {} \;
Expand Down
4 changes: 3 additions & 1 deletion dependente/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Copyright (c) 2021 Leonardo Uieda.
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
"""
Dependente: Extract Python package dependencies from configuration files.

The _version module is generated automatically by setuptools_scm at build time.
"""

from . import _version

__version__ = f"v{_version.version}"
4 changes: 3 additions & 1 deletion dependente/cli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Copyright (c) 2021 Leonardo Uieda.
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
"""
Defines the command line interface.

Uses click to define a CLI around the ``main`` function.
"""

import sys
import traceback
from pathlib import Path
Expand Down
3 changes: 2 additions & 1 deletion dependente/converters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2021 Leonardo Uieda.
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
"""
Functions for manipulating/converting dependency lists.
"""
Expand Down
4 changes: 3 additions & 1 deletion dependente/parsers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Copyright (c) 2021 Leonardo Uieda.
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
"""
Functions for extracting the dependency information from files.
"""

import configparser
from pathlib import Path

Expand Down
4 changes: 4 additions & 0 deletions dependente/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
4 changes: 3 additions & 1 deletion dependente/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Copyright (c) 2021 Leonardo Uieda.
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
"""
Fixtures for pytest
"""

from pathlib import Path

import pytest
Expand Down
4 changes: 4 additions & 0 deletions dependente/tests/test_cli_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
"""
Test utility functions from cli.py
"""
Expand Down
4 changes: 3 additions & 1 deletion dependente/tests/test_converters.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Copyright (c) 2021 Leonardo Uieda.
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
"""
Test functions for converting/transforming dependencies.
"""

import pytest

from ..converters import pin_to_oldest
Expand Down
4 changes: 3 additions & 1 deletion dependente/tests/test_parsers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Copyright (c) 2021 Leonardo Uieda.
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).
"""
Test the functions that extract content from configuration files.

The fixtures (arguments to the test functions) are defined in conftest.py
"""

import pytest

from ..parsers import ParserPyprojectToml, ParserSetupCfg, get_parser, validate_sources
Expand Down
1 change: 1 addition & 0 deletions env/requirements-style.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ flake8-rst-docstrings
flake8-simplify
flake8-unused-arguments
pep8-naming
burocrata
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ dependencies:
- flake8-simplify
- flake8-unused-arguments
- pep8-naming
- pip:
- burocrata
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ write_to = "dependente/_version.py"
[tool.isort]
profile = "black"
multi_line_output = 3

[tool.burocrata]
notice = '''
# Copyright (c) 2021 The Dependente Developers.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
# This code is part of the Fatiando a Terra project (https://www.fatiando.org).'''