Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into feat/cache
Browse files Browse the repository at this point in the history
  • Loading branch information
wizard-28 committed Mar 31, 2022
2 parents 768c85c + 91b8e2a commit bb443d2
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 76 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: codacy-coverage-reporter
name: tests

on: ["push"]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@master
with:
Expand All @@ -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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: [
Expand Down
30 changes: 15 additions & 15 deletions LICENSE_BOILERPLATE
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with
LibPacstall. If not, see <https://www.gnu.org/licenses/>.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<p align="center">
<!-- Programming info -->
<a href="https://www.python.org/"><img alt="python 3.8+" src="https://img.shields.io/badge/python-3.8%2B-306998?logo=python&logoColor=white&style=for-the-badge" /></a>
<a href="https://codecov.io/gh/pacstall/libpacstall">
<img alt="Codecov" src="https://img.shields.io/codecov/c/gh/pacstall/libpacstall?logo=codecov&logoColor=white&style=for-the-badge">
</a>
<a href="https://github.com/psf/black"><img alt="code style: 3.8+" src="https://img.shields.io/badge/code%20style-black-black?style=for-the-badge" /></a>
<a href="https://www.codacy.com/gh/pacstall/libpacstall/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=pacstall/libpacstall&amp;utm_campaign=Badge_Grade">
<img alt="Codacy branch grade" src="https://img.shields.io/codacy/grade/e2155a8b2f0e4804b9c6a4b1441c3b3a?label=code%20quality&logo=codacy&logoColor=white&style=for-the-badge" />
Expand Down
30 changes: 15 additions & 15 deletions libpacstall/__init__.py
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License along with
# LibPacstall. If not, see <https://www.gnu.org/licenses/>.

__version__ = "0.1.0"
39 changes: 21 additions & 18 deletions libpacstall/config.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
# ____ __ ____
# / __ \____ ___________/ /_____ _/ / /
# / /_/ / __ `/ ___/ ___/ __/ __ `/ / /
# / ____/ /_/ / /__(__ ) /_/ /_/ / / /
# /_/ \__,_/\___/____/\__/\__,_/_/_/
# __ _ __ ____ __ ____
# / / (_) /_ / __ \____ ___________/ /_____ _/ / /
# / / / / __ \/ /_/ / __ `/ ___/ ___/ __/ __ `/ / /
# / /___/ / /_/ / ____/ /_/ / /__(__ ) /_/ /_/ / / /
# /_____/_/_.___/_/ \__,_/\___/____/\__/\__,_/_/_/
#
# 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 <https://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License along with
# LibPacstall. If not, see <https://www.gnu.org/licenses/>.

"""Module for config parsing."""

from os import cpu_count, environ
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:
Expand Down Expand Up @@ -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]
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
30 changes: 15 additions & 15 deletions tests/test_config_parser.py
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License along with
# LibPacstall. If not, see <https://www.gnu.org/licenses/>.

"""Tests for the config parser module."""

Expand Down

0 comments on commit bb443d2

Please sign in to comment.