From e8f4fd5b44561afa79929a9ff2012acfa2c7e98e Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 24 Feb 2024 09:18:27 -0800 Subject: [PATCH 1/7] update flake8 config --- .flake8 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 8434b4b..640cbf7 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,9 @@ [flake8] -ignore = E203, W503 +# Ignore +# E203: whitespace before `,` `;` or `:` +# E266: too many leading # for block comment +# E501: line too long +# E701: Multiple statements on one line (colon) +# W503: line break after binary operator +ignore = E203, E266, E501, E701, E704, W503 +max-complexity = 18 From 1698792ff3b4897f89fc35a536b8565317c8c736 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 24 Feb 2024 09:19:32 -0800 Subject: [PATCH 2/7] add basic python gitignore and separate pyosMeta specific ignores --- .gitignore | 169 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 153 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index e6ce84f..368fcd0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,124 @@ -.DS_Store -contrib*.yml -pack*.yml -*.pickle -all_contribs.pickle -all_contribs_dict.pickle -.env -.vscode/ -.idea/ -.token -__pycache__ -.coverage -coverage.xml +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class +# C extensions +*.so # Distribution / packaging .Python build/ +develop-eggs/ dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py # pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: .python-version +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + # Environments .env .venv @@ -30,19 +128,58 @@ ENV/ env.bak/ venv.bak/ +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + # mypy .mypy_cache/ .dmypy.json dmypy.json -token.txt -src/pyosmeta/_version.py +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ -# local files +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +.idea/ + +# macOS +.DS_Store + +# vscode editor +.vscode/ + +# pyosMeta specific +all_contribs.pickle +all_contribs_dict.pickle all-submissions.csv issue-stats.ipynb plot.py presubmissions.csv reviews_all.csv reviews_presubmissions.csv +src/pyosmeta/_version.py src/pyosmeta/cli/test.ipynb + +contrib*.yml +pack*.yml +*.pickle + +.token +token.txt From 3f8ed8f1ab43195e45436226377bcfa8b70c313d Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 24 Feb 2024 09:46:23 -0800 Subject: [PATCH 3/7] Edit comments on precommit config file --- .pre-commit-config.yaml | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7090bbd..d279bc7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,37 +1,35 @@ -# pre-commit is a tool that you run locally -# to perform a predefined set of tasks manually and/or -# automatically before git commits are made. -# Here we are using pre-commit with the precommit.ci bot to implement -# code fixes automagically in pr's. You will still want to install pre-commit -# to run locally -# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level -# To run on a pr, add a comment with the text "pre-commit.ci run" -# Common tasks -# -# - Run on all files: pre-commit run --all-files -# - Register git hooks: pre-commit install --install-hooks +# pre-commit (https://pre-commit.com/) is a tool that runs source code checks +# such as linting, formatting, and code style. + +# CI +# pyosMeta uses pre-commit with the precommit.ci bot to check pull requests. +# Configuration reference doc: https://pre-commit.com/#pre-commit-configyaml---top-level + +# Developers +# You may want to install pre-commit to run locally on each minimum_pre_commit_version +# See https://pre-commit.com/#install +# To set up pre-commit hooks: pre-commit install +# To run on all files: pre-commit run --all-files ci: + # pyosMeta disables autofixing of PRs to simplify new contributor experience and cleaner git history autofix_prs: false - #skip: [flake8, end-of-file-fixer] - autofix_commit_msg: | - '[pre-commit.ci 🤖] Apply code format tools to PR' - # Update hook versions every quarter (so we don't get hit with weekly update pr's) + # Frequency of hook updates autoupdate_schedule: weekly repos: - # Misc commit checks + # Out of the box hooks for pre-commit https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 - # ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available hooks: - # Autoformat: Makes sure files end in a newline and only a newline. + # Makes sure files end in a newline and only a newline. - id: end-of-file-fixer - # Lint: Check for files with names that would conflict on a - # case-insensitive filesystem like MacOS HFS+ or Windows FAT. + # Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT. - id: check-case-conflict + # Remove trailing whitespace on code lines - id: trailing-whitespace + # Spelling hook - repo: https://github.com/codespell-project/codespell rev: v2.2.6 hooks: @@ -39,17 +37,19 @@ repos: additional_dependencies: - tomli - # Linting: Python code (see the file .flake8) + # Linting hook for Python code (see the file .flake8) - repo: https://github.com/PyCQA/flake8 rev: "7.0.0" hooks: - id: flake8 + # Code formatting hook - repo: https://github.com/psf/black rev: 24.2.0 hooks: - id: black + # Best practice style for module imports - repo: https://github.com/PyCQA/isort rev: 5.13.2 hooks: From 7360520e658f51065da3e5db825d4fafafdbdf65 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Mon, 26 Feb 2024 16:44:47 -0800 Subject: [PATCH 4/7] Update .gitignore Co-authored-by: Leah Wasser --- .gitignore | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.gitignore b/.gitignore index 368fcd0..012556d 100644 --- a/.gitignore +++ b/.gitignore @@ -166,19 +166,7 @@ cython_debug/ .vscode/ # pyosMeta specific -all_contribs.pickle -all_contribs_dict.pickle -all-submissions.csv -issue-stats.ipynb -plot.py -presubmissions.csv -reviews_all.csv -reviews_presubmissions.csv src/pyosmeta/_version.py -src/pyosmeta/cli/test.ipynb - -contrib*.yml -pack*.yml *.pickle .token From 4f0570cd054f8177943e196efca93b081c55cf8a Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Mon, 26 Feb 2024 16:44:56 -0800 Subject: [PATCH 5/7] Update .gitignore Co-authored-by: Leah Wasser --- .gitignore | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitignore b/.gitignore index 012556d..98c0cc9 100644 --- a/.gitignore +++ b/.gitignore @@ -132,11 +132,6 @@ venv.bak/ .spyderproject .spyproject -# Rope project settings -.ropeproject - -# mkdocs documentation -/site # mypy .mypy_cache/ From 486f653e6d48a76cffec1f2f317293229b857090 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Mon, 26 Feb 2024 16:45:09 -0800 Subject: [PATCH 6/7] Update .gitignore Co-authored-by: Leah Wasser --- .gitignore | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitignore b/.gitignore index 98c0cc9..b6e174c 100644 --- a/.gitignore +++ b/.gitignore @@ -112,12 +112,6 @@ ipython_config.py # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py # Environments .env From 16d20132784aa171bc7f471ababc2fff4823680b Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Mon, 26 Feb 2024 16:45:17 -0800 Subject: [PATCH 7/7] Update .gitignore Co-authored-by: Leah Wasser --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index b6e174c..7c57042 100644 --- a/.gitignore +++ b/.gitignore @@ -109,8 +109,6 @@ ipython_config.py # https://pdm.fming.dev/#use-with-ide .pdm.toml -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ # Environments