Skip to content

Commit 8d43205

Browse files
authored
Precommit (#64)
* Automatic pre-commit fixes * Fixed variances in tests * precommit cleanup, NullPartitionedGrouped fix * Moved DistributionGenerator to providers.py
1 parent c0202fc commit 8d43205

55 files changed

Lines changed: 11400 additions & 6307 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ on:
99
env:
1010
# This should be the default but we'll be explicit
1111
PRE_COMMIT_HOME: ~/.caches/pre-commit
12-
PYTHON_VERSION: "3.9"
12+
PYTHON_VERSION: "3.10"
1313
jobs:
14-
the_job:
14+
clean-check:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout Code

.github/workflows/tests.yml

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,31 @@ on:
88
- main
99
env:
1010
# This should be the default but we'll be explicit
11-
PYTHON_VERSION: "3.9"
11+
PYTHON_VERSION: "3.10"
1212
jobs:
13-
the_job:
13+
unit-tests:
1414
runs-on: ubuntu-latest
15-
services:
16-
postgres:
17-
image: postgres:15
18-
env:
19-
POSTGRES_PASSWORD: password
20-
ports:
21-
- 5432:5432
2215
steps:
2316
- name: Checkout Code
2417
uses: actions/checkout@v3
25-
- name: Set up Python
26-
uses: actions/setup-python@v4
27-
with:
28-
python-version: ${{ env.PYTHON_VERSION }}
29-
- name: Bootstrap poetry
18+
- name: Start PostgreSQL
3019
shell: bash
3120
run: |
32-
python -m ensurepip
33-
python -m pip install --upgrade pip
34-
python -m pip install poetry
21+
sudo systemctl start postgresql.service
22+
- name: Install poetry
23+
shell: bash
24+
run: |
25+
sudo apt install python3-poetry
3526
- name: Configure poetry
3627
shell: bash
3728
run: |
3829
python -m poetry config virtualenvs.in-project true
39-
# - name: Cache Poetry dependencies
40-
# uses: actions/cache@v3
41-
# id: poetry-cache
42-
# with:
43-
# path: .venv
44-
# key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }}
4530
- name: Install dependencies
4631
shell: bash
4732
if: steps.poetry-cache.outputs.cache-hit != 'true'
4833
run: |
4934
python -m poetry install --all-extras
50-
- name: Create src database
51-
shell: bash
52-
run: |
53-
PGPASSWORD=password psql --host=localhost --username=postgres --set="ON_ERROR_STOP=1" --file=tests/examples/src.dump
54-
- name: Run Unit Tests
35+
- name: Run tests
5536
shell: bash
5637
run: |
57-
REQUIRES_DB=1 poetry run python -m unittest discover --verbose tests
38+
poetry run python -m unittest

.pre-commit-config.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
# See https://pre-commit.com/hooks.html for more hooks
44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.2.0
6+
rev: v6.0.0
77
hooks:
88
- id: trailing-whitespace
9+
exclude: docs/(source|build/html)/_static/
910
- id: end-of-file-fixer
1011
exclude: docs/source/_static/
1112
- id: check-yaml
1213
- id: check-added-large-files
1314
- repo: https://github.com/markdownlint/markdownlint
1415
# Note the "v"
15-
rev: v0.11.0
16+
rev: v0.12.0
1617
hooks:
1718
- id: markdownlint
1819
args: [--style=mdl_style.rb]
1920
- repo: https://github.com/shellcheck-py/shellcheck-py
20-
rev: v0.8.0.4
21+
rev: v0.11.0.1
2122
hooks:
2223
- id: shellcheck
2324
- repo: local
@@ -39,8 +40,7 @@ repos:
3940
language: system
4041
types: ['python']
4142
exclude: (?x)(
42-
tests/examples|
43-
tests/workspace
43+
tests/examples
4444
)
4545
- id: isort
4646
name: isort
@@ -49,7 +49,6 @@ repos:
4949
types: ['python']
5050
exclude: (?x)(
5151
tests/examples|
52-
tests/workspace|
5352
examples
5453
)
5554
- id: pylint
@@ -76,7 +75,6 @@ repos:
7675
language: system
7776
exclude: (?x)(
7877
tests/examples|
79-
tests/workspace|
8078
examples
8179
)
8280
types: ['python']

.pylintrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ ignore=CVS
2424

2525
# Add files or directories matching the regex patterns to the ignore-list. The
2626
# regex matches against paths.
27-
ignore-paths=tests/examples,
28-
tests/workspace
27+
ignore-paths=tests/examples
2928

3029
# Files or directories matching the regex patterns are skipped. The regex
3130
# matches against base names, not paths.
@@ -53,7 +52,7 @@ persistent=yes
5352

5453
# Min Python version to use for version dependend checks. Will default to the
5554
# version used to run pylint.
56-
py-version=3.9
55+
py-version=3.10
5756

5857
# When enabled, pylint would attempt to guess common misconfiguration and emit
5958
# user-friendly hints instead of false-positive error messages.

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-22.04
1111
tools:
12-
python: "3.9"
12+
python: "3.10"
1313
# You can also specify other tool versions:
1414
# nodejs: "19"
1515
# rust: "1.64"

CONTRIBUTING.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ Executing unit tests is straightforward:
4747
python -m unittest discover --verbose tests/
4848
```
4949

50-
for tests that are currently maintained.
51-
52-
## Running functional tests
53-
54-
These tests do not currently work, and will be replaced by unit tests.
55-
56-
Functional tests require PostgreSQL to be installed.
57-
58-
*WARNING: Some MacOS systems [do not recognise the 'en_US.utf8' locale](https://apple.stackexchange.com/questions/206495/load-a-locale-from-usr-local-share-locale-in-os-x). As a workaround, replace `en_US.utf8` with `en_US.UTF-8` on every `*.dump` file.*
59-
6050
## Building documentation locally
6151

6252
```bash

0 commit comments

Comments
 (0)