diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ba1c6b8..cfaddb1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,7 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ada0442..1224edf 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/codacy-coverage-reporter.yml b/.github/workflows/tests.yml similarity index 64% rename from .github/workflows/codacy-coverage-reporter.yml rename to .github/workflows/tests.yml index ba4d0c7..0238a09 100644 --- a/.github/workflows/codacy-coverage-reporter.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: codacy-coverage-reporter +name: tests on: ["push"] @@ -6,7 +6,7 @@ jobs: run: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Python uses: actions/setup-python@master with: @@ -15,15 +15,15 @@ jobs: run: | curl -sSL https://install.python-poetry.org | python3 - poetry install - - name: Run tests + - name: Test LibPacstall run: | poetry run coverage run -m pytest . - name: Generate Coverage Report run: | poetry run coverage report -m poetry run coverage xml - - name: Upload Coverage Report to Codacy - uses: codacy/codacy-coverage-reporter-action@v1 + - name: Upload Coverage Report to CodeCov + uses: codecov/codecov-action@v2 with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - coverage-reports: coverage.xml + fail_ci_if_error: true + verbose: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 10af67d..05a4f1a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ ci: repos: # General - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v4.1.0 hooks: - id: check-added-large-files - id: check-ast @@ -40,7 +40,7 @@ repos: types: [fish] # Misc - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.1.10 + rev: v1.1.13 hooks: - id: insert-license args: [ diff --git a/LICENSE_BOILERPLATE b/LICENSE_BOILERPLATE index 3930cda..ed12f18 100644 --- a/LICENSE_BOILERPLATE +++ b/LICENSE_BOILERPLATE @@ -1,21 +1,21 @@ - ____ __ ____ - / __ \____ ___________/ /_____ _/ / / - / /_/ / __ `/ ___/ ___/ __/ __ `/ / / - / ____/ /_/ / /__(__ ) /_/ /_/ / / / -/_/ \__,_/\___/____/\__/\__,_/_/_/ + __ _ __ ____ __ ____ + / / (_) /_ / __ \____ ___________/ /_____ _/ / / + / / / / __ \/ /_/ / __ `/ ___/ ___/ __/ __ `/ / / + / /___/ / /_/ / ____/ /_/ / /__(__ ) /_/ /_/ / / / +/_____/_/_.___/_/ \__,_/\___/____/\__/\__,_/_/_/ Copyright (C) 2022-present -This file is part of Pacstall +This file is part of LibPacstall. -Pacstall is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 3 of the License +LibPacstall is free software: you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 of the License, or (at your option) any later +version. -Pacstall is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +LibPacstall is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with Pacstall. If not, see . +You should have received a copy of the GNU General Public License along with +LibPacstall. If not, see . diff --git a/README.md b/README.md index 840c89b..e0b8cf8 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@

python 3.8+ + + Codecov + code style: 3.8+ Codacy branch grade diff --git a/libpacstall/__init__.py b/libpacstall/__init__.py index 558ec35..1cfe5eb 100644 --- a/libpacstall/__init__.py +++ b/libpacstall/__init__.py @@ -1,23 +1,23 @@ -# ____ __ ____ -# / __ \____ ___________/ /_____ _/ / / -# / /_/ / __ `/ ___/ ___/ __/ __ `/ / / -# / ____/ /_/ / /__(__ ) /_/ /_/ / / / -# /_/ \__,_/\___/____/\__/\__,_/_/_/ +# __ _ __ ____ __ ____ +# / / (_) /_ / __ \____ ___________/ /_____ _/ / / +# / / / / __ \/ /_/ / __ `/ ___/ ___/ __/ __ `/ / / +# / /___/ / /_/ / ____/ /_/ / /__(__ ) /_/ /_/ / / / +# /_____/_/_.___/_/ \__,_/\___/____/\__/\__,_/_/_/ # # Copyright (C) 2022-present # -# This file is part of Pacstall +# This file is part of LibPacstall. # -# Pacstall is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License +# LibPacstall is free software: you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. # -# Pacstall is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# LibPacstall is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Pacstall. If not, see . +# You should have received a copy of the GNU General Public License along with +# LibPacstall. If not, see . __version__ = "0.1.0" diff --git a/libpacstall/config.py b/libpacstall/config.py index e0e395d..48d44c1 100644 --- a/libpacstall/config.py +++ b/libpacstall/config.py @@ -1,24 +1,24 @@ -# ____ __ ____ -# / __ \____ ___________/ /_____ _/ / / -# / /_/ / __ `/ ___/ ___/ __/ __ `/ / / -# / ____/ /_/ / /__(__ ) /_/ /_/ / / / -# /_/ \__,_/\___/____/\__/\__,_/_/_/ +# __ _ __ ____ __ ____ +# / / (_) /_ / __ \____ ___________/ /_____ _/ / / +# / / / / __ \/ /_/ / __ `/ ___/ ___/ __/ __ `/ / / +# / /___/ / /_/ / ____/ /_/ / /__(__ ) /_/ /_/ / / / +# /_____/_/_.___/_/ \__,_/\___/____/\__/\__,_/_/_/ # # Copyright (C) 2022-present # -# This file is part of Pacstall +# This file is part of LibPacstall. # -# Pacstall is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License +# LibPacstall is free software: you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. # -# Pacstall is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# LibPacstall is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Pacstall. If not, see . +# You should have received a copy of the GNU General Public License along with +# LibPacstall. If not, see . """Module for config parsing.""" @@ -26,7 +26,10 @@ from pathlib import Path from typing import Any, Dict -from tomli import load +try: + import tomllib # type: ignore[unused-import] +except ModuleNotFoundError: + import tomli as tomllib # type: ignore[no-redef] class Settings: @@ -98,8 +101,8 @@ def __init__( config_file.touch(exist_ok=True) with config_file.open(mode="rb") as file: - raw_config = load(file) + raw_config = tomllib.load(file) # type: ignore[unknown-type] self.raw_config = raw_config - self.settings = Settings(raw_config) + self.settings = Settings(raw_config) # type: ignore[unknown-type] diff --git a/poetry.lock b/poetry.lock index fc4e7ab..34084c5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -440,7 +440,7 @@ testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", [metadata] lock-version = "1.1" python-versions = "^3.8" -content-hash = "210232ebe9eef8e75bd23caef42251e8bc0ce6852753164e7ae24613abebc379" +content-hash = "fb923af22b80cc392c3e11b42451b6c96f4f51f880587ba7a57082055af4fbe5" [metadata.files] atomicwrites = [ diff --git a/pyproject.toml b/pyproject.toml index 5753c64..9980c1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,11 +51,11 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.8" -tomli = "^2.0.1" +tomli = { version = "^2.0.1", python = "<3.11" } sqlmodel = "^0.0.6" [tool.poetry.dev-dependencies] -black = "^22.1" +black = "^22.3" codespell = "^2.1.0" isort = "^5.10.1" mypy = "^0.942" diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py index 0e108c2..df54bba 100644 --- a/tests/test_config_parser.py +++ b/tests/test_config_parser.py @@ -1,24 +1,24 @@ -# ____ __ ____ -# / __ \____ ___________/ /_____ _/ / / -# / /_/ / __ `/ ___/ ___/ __/ __ `/ / / -# / ____/ /_/ / /__(__ ) /_/ /_/ / / / -# /_/ \__,_/\___/____/\__/\__,_/_/_/ +# __ _ __ ____ __ ____ +# / / (_) /_ / __ \____ ___________/ /_____ _/ / / +# / / / / __ \/ /_/ / __ `/ ___/ ___/ __/ __ `/ / / +# / /___/ / /_/ / ____/ /_/ / /__(__ ) /_/ /_/ / / / +# /_____/_/_.___/_/ \__,_/\___/____/\__/\__,_/_/_/ # # Copyright (C) 2022-present # -# This file is part of Pacstall +# This file is part of LibPacstall. # -# Pacstall is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License +# LibPacstall is free software: you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. # -# Pacstall is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# LibPacstall is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Pacstall. If not, see . +# You should have received a copy of the GNU General Public License along with +# LibPacstall. If not, see . """Tests for the config parser module."""