From 35022ed01ab2c173904f4e9748125f1bdb4ac13e Mon Sep 17 00:00:00 2001 From: Michael Luciuk Date: Mon, 18 Mar 2024 20:49:19 -0400 Subject: [PATCH 1/8] Adding development dependencies: Flake8, Black, and isort --- poetry.lock | 148 ++++++++++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 13 +++-- tox.ini | 2 +- 3 files changed, 157 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index a5170fb..82d407d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -25,6 +25,52 @@ files = [ [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] +[[package]] +name = "black" +version = "24.3.0" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.8" +files = [ + {file = "black-24.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395"}, + {file = "black-24.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995"}, + {file = "black-24.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7"}, + {file = "black-24.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0"}, + {file = "black-24.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9"}, + {file = "black-24.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597"}, + {file = "black-24.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d"}, + {file = "black-24.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5"}, + {file = "black-24.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f"}, + {file = "black-24.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11"}, + {file = "black-24.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4"}, + {file = "black-24.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5"}, + {file = "black-24.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:79dcf34b33e38ed1b17434693763301d7ccbd1c5860674a8f871bd15139e7837"}, + {file = "black-24.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd"}, + {file = "black-24.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b76c275e4c1c5ce6e9870911384bff5ca31ab63d19c76811cb1fb162678213"}, + {file = "black-24.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:b5991d523eee14756f3c8d5df5231550ae8993e2286b8014e2fdea7156ed0959"}, + {file = "black-24.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c45f8dff244b3c431b36e3224b6be4a127c6aca780853574c00faf99258041eb"}, + {file = "black-24.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6905238a754ceb7788a73f02b45637d820b2f5478b20fec82ea865e4f5d4d9f7"}, + {file = "black-24.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7"}, + {file = "black-24.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:7bb041dca0d784697af4646d3b62ba4a6b028276ae878e53f6b4f74ddd6db99f"}, + {file = "black-24.3.0-py3-none-any.whl", hash = "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93"}, + {file = "black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f"}, +] + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +packaging = ">=22.0" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + [[package]] name = "certifi" version = "2024.2.2" @@ -279,6 +325,22 @@ docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1 testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)"] typing = ["typing-extensions (>=4.8)"] +[[package]] +name = "flake8" +version = "7.0.0" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.0.0-py2.py3-none-any.whl", hash = "sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3"}, + {file = "flake8-7.0.0.tar.gz", hash = "sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.11.0,<2.12.0" +pyflakes = ">=3.2.0,<3.3.0" + [[package]] name = "fonttools" version = "4.49.0" @@ -412,6 +474,20 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + [[package]] name = "jinja2" version = "3.1.3" @@ -674,6 +750,17 @@ pillow = ">=8" pyparsing = ">=2.3.1" python-dateutil = ">=2.7" +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "mpmath" version = "1.3.0" @@ -691,6 +778,17 @@ docs = ["sphinx"] gmpy = ["gmpy2 (>=2.1.0a4)"] tests = ["pytest (>=4.6)"] +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + [[package]] name = "networkx" version = "3.2.1" @@ -906,6 +1004,17 @@ files = [ {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, ] +[[package]] +name = "pathspec" +version = "0.12.1" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, +] + [[package]] name = "pillow" version = "10.2.0" @@ -991,6 +1100,21 @@ tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "pa typing = ["typing-extensions"] xmp = ["defusedxml"] +[[package]] +name = "platformdirs" +version = "4.2.0" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +optional = false +python-versions = ">=3.8" +files = [ + {file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"}, + {file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"}, +] + +[package.extras] +docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] + [[package]] name = "pluggy" version = "1.4.0" @@ -1006,6 +1130,28 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "pycodestyle" +version = "2.11.1" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.11.1-py2.py3-none-any.whl", hash = "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67"}, + {file = "pycodestyle-2.11.1.tar.gz", hash = "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f"}, +] + +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + [[package]] name = "pygments" version = "2.17.2" @@ -1451,4 +1597,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "62d14c25225269e38a0cac587b2f7e962506be6252a3aaf19da96ca67e4fde1f" +content-hash = "f4cab6cb098329f939dda0267147711db9dca66511ee695e401c2a48c7c191f8" diff --git a/pyproject.toml b/pyproject.toml index f0cc441..3b61372 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "ria" version = "0.1.2" description = "Let's build intelligent radios together. 📡🚀" readme = "README.md" -license = "Proprietary" +license = "AGPL-3.0-or-later" keywords = [ "cognitive radio", "intelligent radio", @@ -18,7 +18,7 @@ authors = [ maintainers = [ "Ashkan Beigi ", "Michael Luciuk ", - "Alec Digby ", + "Alec Digby " ] classifiers = [ "Development Status :: 2 - Pre-Alpha", @@ -31,8 +31,8 @@ classifiers = [ "Typing :: Typed" ] packages = [ - { include = "ria" }, - { include = "ria_cli" }, + { include = "ria" }, + { include = "ria_cli" } ] [build-system] @@ -54,6 +54,11 @@ sphinx = "^7.2.6" sphinx-rtd-theme = "^2.0.0" sphinx-autobuild = "^2024.2.4" +[tool.poetry.group.dev.dependencies] +flake8 = "^7.0.0" +black = "^24.3.0" +isort = "^5.13.2" + [tool.poetry.urls] "Qoherent" = "https://www.qoherent.ai/" "Documentation" = "http://docs.radiointelligence.io/" diff --git a/tox.ini b/tox.ini index 112e0fe..f61a6b5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [flake8] max-line-length = 119 -extend-ignore = W503 +extend-ignore = W503, E203, E701 exclude = .git, .github, .idea, .vscode, .github, venv, .venv, build, dist, docs max-complexity = 10 \ No newline at end of file From ce530cc45776b77924fcb52094ee99faf0293466 Mon Sep 17 00:00:00 2001 From: Michael Luciuk Date: Mon, 18 Mar 2024 21:08:36 -0400 Subject: [PATCH 2/8] Adding Black and isort config --- pyproject.toml | 22 ++++++++++++++++++++++ tox.ini | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3b61372..d2d9fda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,3 +67,25 @@ isort = "^5.13.2" [tool.poetry.scripts] ria = "ria_cli.cli:cli" + +[tool.black] +line-length = 119 +target-version = ["py310", "py311", "py312"] +exclude = ''' + /( + \.git + | \.github + | build + | dist + | docs + | venv + | \.venv + | env + | \.env + | \.idea + | \.vscode + )/ +''' + +[tool.isort] +profile = "black" diff --git a/tox.ini b/tox.ini index f61a6b5..68875e0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [flake8] max-line-length = 119 extend-ignore = W503, E203, E701 -exclude = .git, .github, .idea, .vscode, .github, venv, .venv, build, dist, docs +exclude = .git, .github, build, dist, docs, venv, .venv, env, .env, .idea, .vscode max-complexity = 10 \ No newline at end of file From d005c985700c9c875267a6b121ddcc7cf33fc043 Mon Sep 17 00:00:00 2001 From: Michael Luciuk Date: Mon, 18 Mar 2024 21:34:04 -0400 Subject: [PATCH 3/8] Fixing link to issues forum --- .github/CODING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODING.md b/.github/CODING.md index e95dd92..5d7b04f 100644 --- a/.github/CODING.md +++ b/.github/CODING.md @@ -12,7 +12,7 @@ To ensure smooth development, reduce frustration, and minimize conflicts, we kin contributions must adhere to these guidelines. Think there's a better approach? We encourage challenges and discussions to continuously enhance and -refine our approach. You're welcome to present your ideas and rationale on our [ideas forum](https://github.com/qoherent/michael/discussions/categories/ideas). +refine our approach. You're welcome to present your ideas and rationale on our [ideas forum](https://github.com/qoherent/ria/discussions/categories/ideas). ### General guidelines From f3469a50113901e982bc0f484fb1e6f1e649f8ba Mon Sep 17 00:00:00 2001 From: Michael Luciuk Date: Mon, 18 Mar 2024 21:34:21 -0400 Subject: [PATCH 4/8] Updating issue templates --- .github/ISSUE_TEMPLATE/bug-report.md | 29 ++++++++++------------- .github/ISSUE_TEMPLATE/feature-request.md | 29 ++++++++++------------- 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 56acf65..3924208 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -6,24 +6,20 @@ labels: bug 🐞, needs triage 📥 assignees: '' --- + **Description:** [A clear and concise description of the issue.] **Project Area:** -Which aspect of RIA Core are you experiencing issues with? -- [ ] An importable module (e.g., using `from ria import curate` in your Python project) -- [ ] A project script (e.g., executing `ria curate` from the command line) -- [ ] Project documentation or tutorials, including code snippets and graphics -- [ ] CI or DevOps, including our Pytest test suite +[Which aspect of RIA Core are you experiencing issues with?] **Steps to Reproduce:** @@ -48,15 +44,14 @@ Which aspect of RIA Core are you experiencing issues with? **Radio Hardware and Driver Information:** -[Please provide any relevant information about your radio hardware and driver -configurations, including the manufacturer and model number or your radio, as well as -driver version details.] +[Please provide any relevant information about your radio hardware and driver configurations, including the +manufacturer and model number or your radio, as well as driver version details.] **Additional context:** [Any additional details or context about the issue.] -Once your bug report has been submitted, it will be triaged by an authorized Qoherent team member. -Please wait for the issue to be triaged before starting development. This is to ensure your efforts -are focused effectively. Thank you for your patience and understanding. + diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index c17727c..c6484d9 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -7,40 +7,35 @@ assignees: '' --- -Thank you for submitting a feature request. We value your feedback. Before proceeding with a new issue, please -take a moment to review the issue tracker for any existing requests related to the same feature. + **Description:** [A clear and concise description of the feature you'd like to see implemented.] **Project Area:** -To which aspect of RIA Core does this request pertain? -- [ ] The enhancement or addition of an importable module (i.e., using `import ria` in your Python project) -- [ ] The enhancement or addition or a project script (i.e., executing `ria curate` from the command line) -- [ ] Our radio interface tools, such as requesting support for a new radio -- [ ] Project documentation or tutorials, including new or improved code snippets and graphics -- [ ] CI and DevOps, such as new or improved unit tests or GitHub workflows +[To which aspect of RIA Core does this request pertain?] **Is your feature request related to a problem you're having? If so, please describe:** [A clear and concise description of the problem you're experiencing. E.g., I'm always frustrated when ...] -**Is your feature request related to a specific project or research initiative in which you're currently involved? +**Is your feature request related to a specific project or research initiative in which you're currently involved? If so, please describe:** [A clear and concise description of how your feature request relates to any specific projects or research initiatives in which you are currently involved.] **Please share any ideas or suggestions you have for potential solutions:** -[A clear and concise description of any ideas or suggestions you have for potential solutions. -Please include any relevant screenshots or design mockups.] +[A clear and concise description of any ideas or suggestions you have for potential solutions. Please include any +relevant screenshots or design mockups.] **Describe alternatives you've considered:** @@ -51,6 +46,6 @@ Please include any relevant screenshots or design mockups.] [Any additional details or context about the requested feature.] -Once your feature request has been submitted, it will be triaged by an authorized Qoherent team member. -Please wait for the issue to be triaged before starting development. This is to ensure your efforts are -focused effectively. Thank you for your patience and understanding. + From fdb097de44da95e1e39f024b3f4ae66120aec432 Mon Sep 17 00:00:00 2001 From: Michael Luciuk Date: Mon, 18 Mar 2024 21:49:59 -0400 Subject: [PATCH 5/8] Removing broken implementation of `_get_commit_hash()` function, adding Python version, and adding a few more dependencies --- ria/diagnostics/print_version_info.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ria/diagnostics/print_version_info.py b/ria/diagnostics/print_version_info.py index 2e0889f..45df344 100644 --- a/ria/diagnostics/print_version_info.py +++ b/ria/diagnostics/print_version_info.py @@ -11,7 +11,6 @@ import sys import torch -import subprocess from importlib.metadata import version, PackageNotFoundError from typing import Any @@ -26,11 +25,12 @@ def print_version_info() -> None: :return: None """ print(f"\nRIA Core Version: {version('ria')}") + print(f"Python Version: {platform.python_version()}") sys_info = _get_sys_info() cuda_info = _get_cuda_info() dependency_info = _get_dependency_info() - max_len = 15 + max_len = 20 print("\nSYSTEM") print("------") @@ -98,14 +98,23 @@ def _get_dependency_info() -> dict[str, Any]: # required: "matplotlib", "torch", + "numpy", + "pandas", + "click", "dateutil", # install/build: - "poetry" + "poetry", "pip", # test: "pytest", # docs: "sphinx", + "sphinx-rtd-theme", + "sphinx-autobuild", + # dev: + "flake8", + "black", + "isort", # other: ] @@ -126,8 +135,6 @@ def _get_commit_hash() -> str: :raises RuntimeError: If Git is not installed or not accessible from the command line. """ - try: - return subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip().decode('utf-8') - except subprocess.CalledProcessError as e: - raise RuntimeError("Unable to determine commit hash. Please ensure that Git is " - "installed and accessible from the command line.", e.output) + # TODO: Find the Git hash. Note that spawning a subprocess with the command `git rev-parse HEAD` won't work + # outside of the 'ria' development directory. Instead, we need to scrape it from the installed package itself. + return "COULD NOT RESOLVE" From 1d9feeb142a926c7b95da956b6392c0e219a6717 Mon Sep 17 00:00:00 2001 From: Michael Luciuk Date: Mon, 18 Mar 2024 21:57:30 -0400 Subject: [PATCH 6/8] Flake8, Black, and isort fixes --- docs/source/conf.py | 1 + ria/__init__.py | 3 ++- ria/diagnostics/print_version_info.py | 22 ++++++++-------------- ria_cli/cli.py | 13 ++++--------- ria_cli/dataset_manager/commands.py | 1 - ria_cli/diagnostics/commands.py | 1 + ria_cli/model_builder/commands.py | 1 - ria_cli/utils/commands.py | 1 - 8 files changed, 16 insertions(+), 27 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 3bb16c2..b150d32 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -2,6 +2,7 @@ import os import sys + sys.path.insert(0, os.path.abspath(os.path.join('..', '..'))) # -- Project information ----------------------------------------------------- diff --git a/ria/__init__.py b/ria/__init__.py index 87c3142..27c3b27 100644 --- a/ria/__init__.py +++ b/ria/__init__.py @@ -1,4 +1,5 @@ from importlib.metadata import version -__version__ = version('ria') + +__version__ = version("ria") from ria.diagnostics.print_version_info import print_version_info diff --git a/ria/diagnostics/print_version_info.py b/ria/diagnostics/print_version_info.py index 45df344..c94f8e1 100644 --- a/ria/diagnostics/print_version_info.py +++ b/ria/diagnostics/print_version_info.py @@ -4,17 +4,17 @@ This module draws inspiration from Pandas' util._print_versions.py module. """ + import locale import os import platform import struct import sys +from importlib.metadata import PackageNotFoundError, version +from typing import Any import torch -from importlib.metadata import version, PackageNotFoundError -from typing import Any - def print_version_info() -> None: """Print out system, dependency, and CUDA information. @@ -51,7 +51,7 @@ def print_version_info() -> None: def _get_sys_info() -> dict[str, Any]: - """ :return: A dictionary of relevant system information. """ + """:return: A dictionary of relevant system information.""" uname_result = platform.uname() language_code, encoding = locale.getlocale() @@ -72,28 +72,22 @@ def _get_sys_info() -> dict[str, Any]: def _get_cuda_info() -> dict[str, Any]: - """:return: A dictionary of relevant cuda information. """ + """:return: A dictionary of relevant cuda information.""" if torch.cuda.is_available(): return { "available": True, "device": torch.cuda.get_device_name(0), "version": torch.version.cuda, "count": torch.cuda.device_count(), - "index": torch.version.cuda + "index": torch.version.cuda, } else: - return { - "available": False, - "device": None, - "version": None, - "count": None, - "index": None - } + return {"available": False, "device": None, "version": None, "count": None, "index": None} def _get_dependency_info() -> dict[str, Any]: - """:return: A dictionary containing project dependencies along with their respective version numbers. """ + """:return: A dictionary containing project dependencies along with their respective version numbers.""" deps = [ # required: "matplotlib", diff --git a/ria_cli/cli.py b/ria_cli/cli.py index d2e2b8d..192ff17 100644 --- a/ria_cli/cli.py +++ b/ria_cli/cli.py @@ -1,29 +1,24 @@ """ This module contains the main group for the RIA Core CLI. """ + import click -from ria_cli.diagnostics import commands as diagnostic_commands from ria_cli.dataset_manager import commands as dataset_manager_commands +from ria_cli.diagnostics import commands as diagnostic_commands from ria_cli.model_builder import commands as model_builder_commands from ria_cli.utils import commands as utils_commands @click.group() -@click.option('-v', '--verbose', is_flag=True, - help="Increase verbosity, especially useful for debugging.") +@click.option("-v", "--verbose", is_flag=True, help="Increase verbosity, especially useful for debugging.") def cli(verbose: bool): if verbose: click.echo("Verbose mode enabled.") pass -modules = [ - diagnostic_commands, - dataset_manager_commands, - model_builder_commands, - utils_commands -] +modules = [diagnostic_commands, dataset_manager_commands, model_builder_commands, utils_commands] # Loop through the modules, binding all commands to the CLI. for module in modules: diff --git a/ria_cli/dataset_manager/commands.py b/ria_cli/dataset_manager/commands.py index ca67216..e30275f 100644 --- a/ria_cli/dataset_manager/commands.py +++ b/ria_cli/dataset_manager/commands.py @@ -1,4 +1,3 @@ """ This module contains all the CLI bindings for the dataset manager package. """ -import click diff --git a/ria_cli/diagnostics/commands.py b/ria_cli/diagnostics/commands.py index 5b13968..8ea3d38 100644 --- a/ria_cli/diagnostics/commands.py +++ b/ria_cli/diagnostics/commands.py @@ -1,6 +1,7 @@ """ This module contains all the CLI bindings for the diagnostics package. """ + import click from ria import print_version_info as print_version_info diff --git a/ria_cli/model_builder/commands.py b/ria_cli/model_builder/commands.py index ef3cd11..24e3745 100644 --- a/ria_cli/model_builder/commands.py +++ b/ria_cli/model_builder/commands.py @@ -1,4 +1,3 @@ """ This module contains all the CLI bindings for the model builder package. """ -import click diff --git a/ria_cli/utils/commands.py b/ria_cli/utils/commands.py index 285ffb0..b74bb44 100644 --- a/ria_cli/utils/commands.py +++ b/ria_cli/utils/commands.py @@ -1,4 +1,3 @@ """ This module contains all the CLI bindings for the utils package. """ -import click From 36e95d66d77b1c6ddee8b5a5a2737624f3de029c Mon Sep 17 00:00:00 2001 From: Michael Luciuk Date: Mon, 18 Mar 2024 22:01:26 -0400 Subject: [PATCH 7/8] Minor update to the pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index bdda8a5..8de0769 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ **Description:** -[Provide a clear and concise description of the changes and their purpose. Please include any relevant screenshots or -design notes.] +[Provide a clear and concise description of the changes and their purpose. Please include any relevant +screenshots or design notes.] **Related Issues:** @@ -8,8 +8,8 @@ design notes.] **Outstanding Sub-Issues:** -[If there are any outstanding sub-issues or parts of the addressed issues that have not yet been wholly addressed by -this pull request, please describe them here.] +[If there are any outstanding sub-issues or parts of the addressed issues that have not yet been wholly addressed +by this pull request, please describe them here.] **Tips for the Reviewer:** @@ -31,12 +31,12 @@ or whose authorship we cannot verify, may not be accepted. - [ ] I have included unit tests for my code contributions, and all tests are passing. - [ ] The docstrings are complete, include doctests demonstrating usage, and are properly formatted. I have verified that any updates to the project documentation are complete and look okay. -- [ ] I have confirmed all my code contributions are formatted in accordance with the project's Flake8 style -configuration. +- [ ] I have confirmed all my code contributions are formatted in accordance with the project's Flake8, Black, +and isort style configurations. - [ ] No unnecessary changes have been made to the Poetry lock file, but `pyproject.toml` and the Poetry lock file have been updated to reflect any dependency changes. - [ ] I acknowledge that upon the submission of this pull request, Qoherent will assume the copyright for this contribution. -A heartfelt thank you from everyone at Qoherent and the broader radio community for taking the time to contribute to -RIA Core. 🙏💖 + From 0760427b59d008fdd48f39ee6b5a4eecc0f374bc Mon Sep 17 00:00:00 2001 From: Michael Luciuk Date: Mon, 18 Mar 2024 22:12:26 -0400 Subject: [PATCH 8/8] Adding guidelines for Black and isort --- .github/CODING.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/CODING.md b/.github/CODING.md index 5d7b04f..1357ad8 100644 --- a/.github/CODING.md +++ b/.github/CODING.md @@ -32,9 +32,15 @@ automatically integrated into the RIA CLI. ### Python-specific guidelines -We use [Flake8](https://flake8.pycqa.org/en/latest/) for code linting and style enforcement. All Python code must -be formatted in accordance with the Flake8 configuration settings defined in the [tox.ini](../tox.ini) file -in the root of the project. +We utilize [Black](https://black.readthedocs.io/en/stable/) for automated code formatting, with configuration +settings defined in `pyproject.toml`. Please ensure that all code contributions are auto-formatted with Black, +this is important to ensure consistent and reliably formatted code. + +We rely on [isort](https://pycqa.github.io/isort/index.html) for import sorting, with configuration settings defined +in `pyproject.toml`. Please use isort to automatically organize your import statements. + +We use [Flake8](https://flake8.pycqa.org/en/latest/) for code linting and style. All Python code must be formatted in accordance with the Flake8 +configuration settings defined in [tox.ini](../tox.ini). To ensure a consistent development environment, this project uses [Poetry](https://python-poetry.org/) for dependency management. [Start here](https://python-poetry.org/docs/basic-usage/) for information on basic Poetry usage. Please refrain from making unnecessary updates to the @@ -195,8 +201,10 @@ poetry run pytest ``` -4. Confirm your changes are formatted in accordance with our Flake8 style configuration: +4. Confirm your changes are formatted in accordance with our Black, isort, and Flake8 style configurations: ```commandline +black . +isort . flake8 . ```