From 58314e3eb5b84e09039f818be00d1e0cca510d9b Mon Sep 17 00:00:00 2001 From: Richard Sundqvist Date: Sat, 5 Mar 2022 18:14:19 +0000 Subject: [PATCH] Drop Python 3.7, tinker with devopsy stuff Too much stuff to list here.. Partial changes: - Relax a bunch of overly-zealous linter args - Ignore missing AssertionError in docstrings - Lock down bandit (see: https://github.com/tylerwince/flake8-bandit/issues/21) - Disable strict optional - Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy - Update lockfile - Remove unused module - Basic logging configuration (null handler) - Use Poetry 1.2.0.a2 for builds Notebooks: - Add formatting of notebooks - Add run-jupyter.sh convenience script (nosec) - Add PerfTestTemplate.ipynb --- .bumpversion.cfg | 2 +- .coveragerc | 29 + .darglint | 1 + .github/workflows/pre-commit-autoupdate.yml | 4 +- .github/workflows/release.yml | 8 +- .github/workflows/tests.yml | 19 +- .gitignore | 9 + .idea/runConfigurations/run_all_tests.xml | 8 +- .pre-commit-config.yaml | 6 +- .readthedocs.yml | 2 +- .venv/!PLACEHOLDER.md | 7 + CHANGELOG.md | 7 + README.md | 56 +- docs/conf.py | 51 +- docs/nitpick-regex-exceptions | 19 + jupyterlab/NOTES.md | 25 + jupyterlab/jupyter_lab_config.py | 7 + jupyterlab/perf-test/PerfTestTemplate.ipynb | 289 +++ mypy.ini | 6 +- noxfile.py | 4 +- poetry.lock | 1754 ++++++++++++++++++- pyproject.toml | 82 +- run-invocations.sh | 18 + run-jupyter.sh | 22 + src/rics/__init__.py | 19 +- src/rics/__version__.py | 7 + src/rics/cli.py | 17 - src/rics/rics.py | 1 - tasks.py | 7 +- tests/__init__.py | 1 - tests/test_cli.py | 24 - tests/test_rics.py | 17 - 32 files changed, 2323 insertions(+), 205 deletions(-) create mode 100644 .coveragerc create mode 100644 .venv/!PLACEHOLDER.md create mode 100644 docs/nitpick-regex-exceptions create mode 100644 jupyterlab/NOTES.md create mode 100644 jupyterlab/jupyter_lab_config.py create mode 100644 jupyterlab/perf-test/PerfTestTemplate.ipynb create mode 100755 run-invocations.sh create mode 100755 run-jupyter.sh create mode 100644 src/rics/__version__.py delete mode 100644 src/rics/cli.py delete mode 100644 src/rics/rics.py delete mode 100644 tests/__init__.py delete mode 100644 tests/test_cli.py delete mode 100644 tests/test_rics.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 700ae666..1d98c919 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -7,7 +7,7 @@ current_version = 0.1.0 search = version = "{current_version}" replace = version = "{new_version}" -[bumpversion:file:src/rics/__init__.py] +[bumpversion:file:src/rics/__version__.py] search = __version__ = "{current_version}" replace = __version__ = "{new_version}" diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..ef3bca04 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,29 @@ +[paths] +source = src + +[report] +omit = + tests/* + src/rics/translation/fetching/* + src/rics/translation/dio/* + src/rics/_internal* + */exceptions.py + +fail_under = 99 + +exclude_lines = + pragma: no cover + def __repr__ + if self.debug + if settings.DEBUG: + raise AssertionError + raise NotImplementedError + if 0: + if __name__ == __main__: + LOGGER.isEnabledFor + if not isinstance\(other + +show_missing = true + +[html] +directory = htmlcov diff --git a/.darglint b/.darglint index 2b03755a..944ae38c 100644 --- a/.darglint +++ b/.darglint @@ -1,2 +1,3 @@ [darglint] strictness = short +ignore_raise=AssertionError diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index 3d01ece2..0fe73b8b 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v2.3.2 with: - python-version: 3.7 + python-version: 3.8 - name: Install pre-commit run: pip install pre-commit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d54843ae..6f07c489 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,16 +11,16 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v2.3.2 with: - python-version: 3.7 + python-version: 3.8 - name: Install system deps shell: bash run: | - pip install poetry - poetry config virtualenvs.in-project true + curl -sSL https://install.python-poetry.org/ | python - + poetry self update --preview 1.2.0a2 - name: Build package run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d0a7d5b..11cec6f6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,6 +3,7 @@ name: tests on: push: branches: + - master pull_request: branches: @@ -13,10 +14,10 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v2.3.2 with: - python-version: 3.7 + python-version: 3.8 - name: Linting run: | @@ -30,7 +31,7 @@ jobs: strategy: matrix: os: [ Ubuntu, MacOS, Windows ] - python-version: [ '3.7', '3.8', '3.9', '3.10' ] + python-version: [ '3.8', '3.9', '3.10' ] fail-fast: true steps: - uses: actions/checkout@v2.3.4 @@ -44,8 +45,8 @@ jobs: shell: bash run: | pip install nox - pip install poetry - poetry config virtualenvs.in-project true + curl -sSL https://install.python-poetry.org/ | python - + poetry self update --preview 1.2.0a2 - name: Run mypy with nox shell: bash @@ -72,17 +73,17 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v2.3.2 with: - python-version: 3.7 + python-version: 3.8 - name: Install system deps shell: bash run: | pip install nox - pip install poetry - poetry config virtualenvs.in-project true + curl -sSL https://install.python-poetry.org/ | python - + poetry self update --preview 1.2.0a2 - name: Download coverage data uses: actions/download-artifact@v2.1.0 diff --git a/.gitignore b/.gitignore index afeea786..9bc2ef61 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ +codecov + +# Data +*.pkl +*.gz +*.zip +*.csv +jupyterlab/data-cache/* + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/.idea/runConfigurations/run_all_tests.xml b/.idea/runConfigurations/run_all_tests.xml index 3ab10d3a..a03e4acd 100644 --- a/.idea/runConfigurations/run_all_tests.xml +++ b/.idea/runConfigurations/run_all_tests.xml @@ -1,11 +1,11 @@ - +