diff --git a/.github/workflows/poetry.yml b/.github/workflows/poetry.yml index baa1a4c..0989b26 100644 --- a/.github/workflows/poetry.yml +++ b/.github/workflows/poetry.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.11", "3.12" ] + python-version: [ "3.10", "3.11", "3.12" ] poetry-version: [ "1.8.3" ] os: [ ubuntu-22.04, macos-12, windows-2022 ] runs-on: ${{ matrix.os }} @@ -49,3 +49,24 @@ jobs: - name: Poetry build run: | poetry install + check: + strategy: + fail-fast: false + matrix: + python-version: [ "3.10", "3.11", "3.12" ] + poetry-version: [ "1.8.3" ] + os: [ ubuntu-22.04 ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Run image + uses: abatilo/actions-poetry@v2 + with: + poetry-version: ${{ matrix.poetry-version }} + - name: Check with Pylint and Flake8 + run: | + poetry install + git ls-files '*.py' | xargs -I {} sh -c 'poetry run pylint "$@" && poetry run flake8 "$@"' _ {} diff --git a/.gitignore b/.gitignore index 3e49db1..e7c033b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build/ +dist/ venv/ bin/ pwd/ diff --git a/pyproject.toml b/pyproject.toml index b65b518..c7faa59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ license = "MIT" readme = "README.md" [tool.poetry.dependencies] -python = "^3.11 || ^3.12" +python = "^3.10 || ^3.11 || ^3.12" sr-data = { path = "./sr-data" } sr-train = { path = "./sr-train" } sr-detector = { path = "./sr-detector" } @@ -37,10 +37,6 @@ sr-detector = { path = "./sr-detector" } pylint = "^3.2.5" flake8 = "^7.1.0" -[tool.poetry.scripts] -pylint = "pylint ." -flake8 = "flake8 ." - [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" diff --git a/sr-data/pyproject.toml b/sr-data/pyproject.toml index 2c0bf14..87b7cce 100644 --- a/sr-data/pyproject.toml +++ b/sr-data/pyproject.toml @@ -22,14 +22,17 @@ [tool.poetry] name = "sr-data" version = "0.0.0" -description = "Collected, processed data from GitHub API to CSV" +description = "GitHub repositories data to vectors" authors = ["h1alexbel "] license = "MIT" readme = "README.md" +packages = [{include = "sr_data", from = "src"}] [tool.poetry.dependencies] -python = "^3.11 || ^3.12" +python = "^3.10 || ^3.11 || ^3.12" +[tool.poetry.scripts] +sr-data = "sr_data.all:main" [build-system] requires = ["setuptools", "wheel"] diff --git a/sr-data/src/sr_data/__init__.py b/sr-data/src/sr_data/__init__.py new file mode 100644 index 0000000..1351e23 --- /dev/null +++ b/sr-data/src/sr_data/__init__.py @@ -0,0 +1,21 @@ +# The MIT License (MIT) +# +# Copyright (c) 2024 Aliaksei Bialiauski +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. diff --git a/sr-data/src/sr_data/all.py b/sr-data/src/sr_data/all.py new file mode 100644 index 0000000..6833135 --- /dev/null +++ b/sr-data/src/sr_data/all.py @@ -0,0 +1,40 @@ +""" +Run all tasks. +""" +# The MIT License (MIT) +# +# Copyright (c) 2024 Aliaksei Bialiauski +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +from .verifications.install import install + + +def main(): + """ + Run all tasks. + """ + install( + [ + "npm install -g ghminer@0.0.5", + ] + ) + + +if __name__ == "__main__": + main() diff --git a/sr-data/src/sr_data/verifications/__init__.py b/sr-data/src/sr_data/verifications/__init__.py new file mode 100644 index 0000000..1351e23 --- /dev/null +++ b/sr-data/src/sr_data/verifications/__init__.py @@ -0,0 +1,21 @@ +# The MIT License (MIT) +# +# Copyright (c) 2024 Aliaksei Bialiauski +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. diff --git a/sr-data/src/sr_data/verifications/install.py b/sr-data/src/sr_data/verifications/install.py new file mode 100644 index 0000000..899268c --- /dev/null +++ b/sr-data/src/sr_data/verifications/install.py @@ -0,0 +1,35 @@ +""" +install.py +""" +# The MIT License (MIT) +# +# Copyright (c) 2024 Aliaksei Bialiauski +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +import os + + +def install(commands: []): + """ + Install tools using provided commands. + """ + print("Installing tools...") + for cmd in commands: + os.system(cmd) + os.system("echo \"All dependencies are installed and up to date!\"") diff --git a/sr-detector/pyproject.toml b/sr-detector/pyproject.toml index ce5ae8f..7430aef 100644 --- a/sr-detector/pyproject.toml +++ b/sr-detector/pyproject.toml @@ -28,7 +28,7 @@ license = "MIT" readme = "README.md" [tool.poetry.dependencies] -python = "^3.11 || ^3.12" +python = "^3.10 || ^3.11 || ^3.12" [build-system] requires = ["setuptools", "wheel"] diff --git a/sr-train/pyproject.toml b/sr-train/pyproject.toml index da66633..691faa0 100644 --- a/sr-train/pyproject.toml +++ b/sr-train/pyproject.toml @@ -28,7 +28,7 @@ license = "MIT" readme = "README.md" [tool.poetry.dependencies] -python = "^3.11 || ^3.12" +python = "^3.10 || ^3.11 || ^3.12" [build-system]