From 551692eca8a15b3e7564a71fb43acbb872d107f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20A=2E=20Fidalgo-Rodr=C3=ADguez?= Date: Mon, 27 May 2024 01:28:11 -0400 Subject: [PATCH 01/19] add pyproject.toml and change pre-commit --- .pre-commit-config.yaml | 28 +++++---------------- pyproject.toml | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 22 deletions(-) create mode 100644 pyproject.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad2e4fe..b44a98b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,18 +20,8 @@ repos: - id: trailing-whitespace args: - "--markdown-linebreak-ext=md" - - repo: "https://github.com/pre-commit/pygrep-hooks" - rev: v1.9.0 - hooks: - - id: python-check-blanket-noqa - - id: python-check-blanket-type-ignore - - id: python-use-type-annotations - - repo: "https://github.com/pycqa/isort" - rev: 5.10.1 - hooks: - - id: isort - - repo: "https://github.com/psf/black" - rev: 22.3.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: "23.9.1" hooks: - id: black - repo: "https://github.com/pre-commit/mirrors-prettier" @@ -49,14 +39,8 @@ repos: - id: pyupgrade args: - "--py36-plus" - - repo: https://github.com/pycqa/pylint - # 2.13.9 is the last version supporting Python 3.6 - rev: v2.13.9 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.4.5" hooks: - - id: pylint - - repo: "https://github.com/fsfe/reuse-tool" - rev: v0.14.0 - hooks: - - id: reuse - additional_dependencies: - - python-debian==0.1.40 + - id: ruff + args: ["--fix", "--show-fixes"] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..483022a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,55 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "planetsmath" +requires-python = ">= 3.8" +version = "0.0.1" +description = "Lovely Spam! Wonderful Spam!" +readme = "README.md" +license = {file = "LICENSE"} + +[tool.ruff] +select = [ + "E", "F", "W", # flake8 + "B", # flake8-bugbear + "I", # isort + "ARG", # flake8-unused-arguments + "C4", # flake8-comprehensions + "EM", # flake8-errmsg + "ICN", # flake8-import-conventions + "ISC", # flake8-implicit-str-concat + "G", # flake8-logging-format + "PGH", # pygrep-hooks + "PIE", # flake8-pie + "PL", # pylint + "PT", # flake8-pytest-style + "PTH", # flake8-use-pathlib + "RET", # flake8-return + "RUF", # Ruff-specific + "SIM", # flake8-simplify + "T20", # flake8-print + "UP", # pyupgrade + "YTT", # flake8-2020 + "EXE", # flake8-executable + "NPY", # NumPy specific rules + "PD", # pandas-vet +] +extend-ignore = [ + "PLR", # Design related pylint codes + "E501", # Line too long + "PT004", # Use underscore for non-returning fixture (use usefixture instead) +] +typing-modules = ["mypackage._compat.typing"] +src = ["src"] +unfixable = [ + "T20", # Removes print statements + "F841", # Removes unused variables +] +exclude = [] +flake8-unused-arguments.ignore-variadic-names = true +isort.required-imports = ["from __future__ import annotations"] + +[tool.ruff.per-file-ignores] +"tests/**" = ["T20"] \ No newline at end of file From ebca9e878504ed6ad74345bcaa90fe410ebbef84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20A=2E=20Fidalgo-Rodr=C3=ADguez?= Date: Mon, 27 May 2024 01:31:12 -0400 Subject: [PATCH 02/19] delete file --- newfile2 | 1 - 1 file changed, 1 deletion(-) delete mode 100644 newfile2 diff --git a/newfile2 b/newfile2 deleted file mode 100644 index 345e6ae..0000000 --- a/newfile2 +++ /dev/null @@ -1 +0,0 @@ -Test From 147488fbee500dafacd41be5f36db3448b8e524d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20A=2E=20Fidalgo-Rodr=C3=ADguez?= Date: Mon, 27 May 2024 01:34:31 -0400 Subject: [PATCH 03/19] add licensing text --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 483022a..f21e5d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2022 Fermi Research Alliance, LLC +# SPDX-License-Identifier: Apache-2.0 + [build-system] requires = ["hatchling"] build-backend = "hatchling.build" From f12d97c326b94bfb9821cf5122721c78304c4b1c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 05:39:23 +0000 Subject: [PATCH 04/19] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- setup.py | 1 + src/planetsmath/functions.py | 1 + src/planetsmath/test_functions.py | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b44a98b..17afa7e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,4 +43,4 @@ repos: rev: "v0.4.5" hooks: - id: ruff - args: ["--fix", "--show-fixes"] \ No newline at end of file + args: ["--fix", "--show-fixes"] diff --git a/pyproject.toml b/pyproject.toml index f21e5d2..222d894 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,4 +55,4 @@ flake8-unused-arguments.ignore-variadic-names = true isort.required-imports = ["from __future__ import annotations"] [tool.ruff.per-file-ignores] -"tests/**" = ["T20"] \ No newline at end of file +"tests/**" = ["T20"] diff --git a/setup.py b/setup.py index 9382ce1..861d9d0 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ # SPDX-FileCopyrightText: 2022 Fermi Research Alliance, LLC # SPDX-License-Identifier: Apache-2.0 +from __future__ import annotations from setuptools import setup diff --git a/src/planetsmath/functions.py b/src/planetsmath/functions.py index 02e76fe..056a04f 100644 --- a/src/planetsmath/functions.py +++ b/src/planetsmath/functions.py @@ -1,5 +1,6 @@ # SPDX-FileCopyrightText: 2022 Fermi Research Alliance, LLC # SPDX-License-Identifier: Apache-2.0 +from __future__ import annotations def sum_function(list): diff --git a/src/planetsmath/test_functions.py b/src/planetsmath/test_functions.py index a81a26d..a23effb 100644 --- a/src/planetsmath/test_functions.py +++ b/src/planetsmath/test_functions.py @@ -1,5 +1,6 @@ # SPDX-FileCopyrightText: 2022 Fermi Research Alliance, LLC # SPDX-License-Identifier: Apache-2.0 +from __future__ import annotations from .functions import sum_function From bad43681b981fc621680d90a813fbbdc7a0e2068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20A=2E=20Fidalgo-Rodr=C3=ADguez?= Date: Mon, 27 May 2024 01:47:13 -0400 Subject: [PATCH 05/19] Update pyproject.toml --- pyproject.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 222d894..2b9b214 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ readme = "README.md" license = {file = "LICENSE"} [tool.ruff] -select = [ +lint.select = [ "E", "F", "W", # flake8 "B", # flake8-bugbear "I", # isort @@ -39,20 +39,20 @@ select = [ "NPY", # NumPy specific rules "PD", # pandas-vet ] -extend-ignore = [ +lint.extend-ignore = [ "PLR", # Design related pylint codes "E501", # Line too long "PT004", # Use underscore for non-returning fixture (use usefixture instead) ] -typing-modules = ["mypackage._compat.typing"] +lint.typing-modules = ["mypackage._compat.typing"] src = ["src"] -unfixable = [ +lint.unfixable = [ "T20", # Removes print statements "F841", # Removes unused variables ] exclude = [] -flake8-unused-arguments.ignore-variadic-names = true -isort.required-imports = ["from __future__ import annotations"] +lint.flake8-unused-arguments.ignore-variadic-names = true +lint.isort.required-imports = ["from __future__ import annotations"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "tests/**" = ["T20"] From e067de085a79bd0b124b09971c7d11821d3f7a3f Mon Sep 17 00:00:00 2001 From: Guillermo Fidalgo Date: Thu, 30 May 2024 11:08:55 -0500 Subject: [PATCH 06/19] adding this awesome file --- src/planetsmath/myfile_guillermo.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/planetsmath/myfile_guillermo.txt diff --git a/src/planetsmath/myfile_guillermo.txt b/src/planetsmath/myfile_guillermo.txt new file mode 100644 index 0000000..df0654a --- /dev/null +++ b/src/planetsmath/myfile_guillermo.txt @@ -0,0 +1 @@ +Cold and dry, but everything is my favorite color From 815dc2322089ba7bea8240fd5d9030b6a82bf27f Mon Sep 17 00:00:00 2001 From: Jakia Chowdhury Date: Thu, 30 May 2024 11:09:08 -0500 Subject: [PATCH 07/19] Adding a test text file --- src/planetsmath/myFile.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/planetsmath/myFile.txt diff --git a/src/planetsmath/myFile.txt b/src/planetsmath/myFile.txt new file mode 100644 index 0000000..c01f67c --- /dev/null +++ b/src/planetsmath/myFile.txt @@ -0,0 +1 @@ +Thunderstorms From 1987facf224ec77ce0dc93babd0495e592dbcff3 Mon Sep 17 00:00:00 2001 From: Jakia Chowdhury Date: Thu, 30 May 2024 11:35:53 -0500 Subject: [PATCH 08/19] Here is an edited version --- src/planetsmath/myFile.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/planetsmath/myFile.txt b/src/planetsmath/myFile.txt index c01f67c..d1da53e 100644 --- a/src/planetsmath/myFile.txt +++ b/src/planetsmath/myFile.txt @@ -1 +1,3 @@ -Thunderstorms +Thunderstorms! +That's my favorite weather! +Why does Fermilab have a tornado shelter? From 4ef36edb11e956a6cae80cc9a69e3bdce3072cc3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 16:36:31 +0000 Subject: [PATCH 09/19] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/planetsmath/myFile.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/planetsmath/myFile.txt b/src/planetsmath/myFile.txt index d1da53e..e5088f0 100644 --- a/src/planetsmath/myFile.txt +++ b/src/planetsmath/myFile.txt @@ -1,3 +1,3 @@ Thunderstorms! That's my favorite weather! -Why does Fermilab have a tornado shelter? +Why does Fermilab have a tornado shelter? From 981d92f4cda131dba65123978de4e590929f44e7 Mon Sep 17 00:00:00 2001 From: Roy Cruz Date: Thu, 30 May 2024 11:38:38 -0500 Subject: [PATCH 10/19] Awesome change --- src/planetsmath/myfile_guillermo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/planetsmath/myfile_guillermo.txt b/src/planetsmath/myfile_guillermo.txt index df0654a..14bed87 100644 --- a/src/planetsmath/myfile_guillermo.txt +++ b/src/planetsmath/myfile_guillermo.txt @@ -1 +1 @@ -Cold and dry, but everything is my favorite color +Cold and dry, but everything is my least favorite color From e477f7a38440cb0270c11db293d99ae64033345d Mon Sep 17 00:00:00 2001 From: Roy Cruz Date: Thu, 30 May 2024 11:39:56 -0500 Subject: [PATCH 11/19] Change to py file --- src/planetsmath/functions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/planetsmath/functions.py b/src/planetsmath/functions.py index 056a04f..57dffde 100644 --- a/src/planetsmath/functions.py +++ b/src/planetsmath/functions.py @@ -24,8 +24,11 @@ def sum_function(list): return sum -def sum_product(list): +def sum_product(lists): product = 1.0 - for item in list: + for item in lists: product *= item return product + +def print_hello(): + print("hello!") From 6f4c4b337831f1a42097d28eda5b678103f1ed70 Mon Sep 17 00:00:00 2001 From: Roy Cruz Date: Thu, 30 May 2024 11:41:12 -0500 Subject: [PATCH 12/19] Trying again to create conflit --- src/planetsmath/functions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/planetsmath/functions.py b/src/planetsmath/functions.py index 57dffde..d1ad081 100644 --- a/src/planetsmath/functions.py +++ b/src/planetsmath/functions.py @@ -23,12 +23,14 @@ def sum_function(list): sum += item return sum +def print_hello(): + print("hello!") def sum_product(lists): + def print_hello(): + print("hello!") product = 1.0 for item in lists: product *= item return product -def print_hello(): - print("hello!") From 2563b7db1f882798abc5f2439cfc526eeb063a21 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 16:46:05 +0000 Subject: [PATCH 13/19] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/planetsmath/functions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/planetsmath/functions.py b/src/planetsmath/functions.py index d1ad081..243abaa 100644 --- a/src/planetsmath/functions.py +++ b/src/planetsmath/functions.py @@ -23,14 +23,16 @@ def sum_function(list): sum += item return sum + def print_hello(): print("hello!") + def sum_product(lists): def print_hello(): print("hello!") + product = 1.0 for item in lists: product *= item return product - From a708abc607dbf21a517f8f32d12dba22317e93e2 Mon Sep 17 00:00:00 2001 From: Guillermo Fidalgo Date: Thu, 30 May 2024 11:46:54 -0500 Subject: [PATCH 14/19] adding more awesome changes --- src/planetsmath/myfile_guillermo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/planetsmath/myfile_guillermo.txt b/src/planetsmath/myfile_guillermo.txt index df0654a..c732329 100644 --- a/src/planetsmath/myfile_guillermo.txt +++ b/src/planetsmath/myfile_guillermo.txt @@ -1 +1 @@ -Cold and dry, but everything is my favorite color +Cold and dry, but nothing is the best color From 5a21d51ad560d4cf4712ff8ba72ea4106fd49482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20A=2E=20Fidalgo-Rodr=C3=ADguez?= Date: Tue, 20 Jan 2026 00:07:36 -0600 Subject: [PATCH 15/19] updating my ci --- .github/workflows/linters.yaml | 12 ++++++------ .github/workflows/pytest.yaml | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index a736465..41bac2d 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -17,11 +17,11 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout code tree - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 + uses: actions/checkout@v6 + - name: Set up Python 3.9 + uses: actions/setup-python@v6 with: - python-version: "3.7" + python-version: "3.9" architecture: "x64" - name: Install dependencies run: | @@ -42,5 +42,5 @@ jobs: name: Run REUSE to check license compliance runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: fsfe/reuse-action@v1 + - uses: actions/checkout@v6 + - uses: fsfe/reuse-action@v6 diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 35e082f..ec5eda8 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -17,11 +17,11 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout code tree - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 + uses: actions/checkout@v6 + - name: Set up Python 3.9 + uses: actions/setup-python@v6 with: - python-version: "3.7" + python-version: "3.9" architecture: "x64" - name: Install dependencies run: | From d0dc90e348ca8d14a28143f36f74124b856f24d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20A=2E=20Fidalgo-Rodr=C3=ADguez?= Date: Tue, 20 Jan 2026 00:11:24 -0600 Subject: [PATCH 16/19] add license for REUSE --- src/planetsmath/myFile.txt | 3 +++ src/planetsmath/myfile_guillermo.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/planetsmath/myFile.txt b/src/planetsmath/myFile.txt index e5088f0..6936e21 100644 --- a/src/planetsmath/myFile.txt +++ b/src/planetsmath/myFile.txt @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2022 Fermi Research Alliance, LLC +# SPDX-License-Identifier: Apache-2.0 + Thunderstorms! That's my favorite weather! Why does Fermilab have a tornado shelter? diff --git a/src/planetsmath/myfile_guillermo.txt b/src/planetsmath/myfile_guillermo.txt index 733a51f..bf0a532 100644 --- a/src/planetsmath/myfile_guillermo.txt +++ b/src/planetsmath/myfile_guillermo.txt @@ -1 +1,4 @@ +# SPDX-FileCopyrightText: 2022 Fermi Research Alliance, LLC +# SPDX-License-Identifier: Apache-2.0 + nothing is the best color but everything is my least favorite color \ No newline at end of file From 2da86fd5f6d00c945f604dac96afefa0cd5c9ac3 Mon Sep 17 00:00:00 2001 From: jmorgan-15 Date: Wed, 21 Jan 2026 19:38:47 -0600 Subject: [PATCH 17/19] The local changes I made --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ca208f1..4960771 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,5 @@ This code is distributed under the Apache 2.0 license, see the [LICENSE](LICENSE ## Getting Started with development There is a specfic document on this at [DEVELOPMENT.md](DEVELOPMENT.md) + +These are locally made changes to my fork. From 4ceded41557fcbc9e51deb1793b1d6e08883d9f5 Mon Sep 17 00:00:00 2001 From: jitu16 Date: Wed, 21 Jan 2026 19:45:08 -0600 Subject: [PATCH 18/19] Changes from G2! --- README.md | 2 ++ g2.py | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 g2.py diff --git a/README.md b/README.md index ca208f1..16b2dfb 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,5 @@ This code is distributed under the Apache 2.0 license, see the [LICENSE](LICENSE ## Getting Started with development There is a specfic document on this at [DEVELOPMENT.md](DEVELOPMENT.md) + +This is g2! diff --git a/g2.py b/g2.py new file mode 100644 index 0000000..643a2d4 --- /dev/null +++ b/g2.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +def foo(): + print("Hi") + +foo From 13222caece5e558b78382bfdf700590f948e8c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20A=2E=20Fidalgo-Rodr=C3=ADguez?= Date: Wed, 21 Jan 2026 20:00:54 -0600 Subject: [PATCH 19/19] Add SPDX license headers to g2.py Add SPDX license information to g2.py --- g2.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/g2.py b/g2.py index 643a2d4..def1538 100644 --- a/g2.py +++ b/g2.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2022 Fermi Research Alliance, LLC +# SPDX-License-Identifier: Apache-2.0 + #!/usr/bin/env python3 def foo(): print("Hi")