diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 2b3720f9..00000000 --- a/.flake8 +++ /dev/null @@ -1,11 +0,0 @@ -# Taken directly from https://github.com/ambv/black/blob/master/.flake8 -[flake8] -ignore = E203, E266, E501, W503, C901, D104, D100, D101, D102, D103, D105, D401 -max-line-length = 88 -max-complexity = 18 -select = B,C,E,F,W,T4,B9,D -enable-extensions = flake8-docstrings -per-file-ignores = - tests/**:D101,D102,D103 - src/datajudge/__init__.py:F401 -docstring-convention = numpy diff --git a/.github/.pull_request_template.md b/.github/.pull_request_template.md index f81b1bee..0e11397f 100644 --- a/.github/.pull_request_template.md +++ b/.github/.pull_request_template.md @@ -1,5 +1,5 @@ # CI - \ No newline at end of file +--> diff --git a/.github/actions/pytest/action.yml b/.github/actions/pytest/action.yml deleted file mode 100644 index c2682024..00000000 --- a/.github/actions/pytest/action.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: pytest -description: installs package, runs pytest and creates coverage report. - -inputs: - backend: - description: which database backend to use - required: false - args: - description: arguments that are passed to pytest, e.g. "-k filter" or "tests/integration" - required: false - -runs: - using: composite - steps: - - name: Run Integration Tests - shell: bash -l {0} - run: | - flit install -s - if [[ "${{ inputs.backend }}" != "" ]]; then - pytest --verbose --cov=datajudge --cov-report=xml --cov-append --backend=${{ inputs.backend }} ${{ inputs.args }} - else - pytest --verbose --cov=datajudge --cov-report=xml --cov-append ${{ inputs.args }} - fi - - name: Generate code coverage report - uses: codecov/codecov-action@v3.1.3 - with: - file: ./coverage.xml diff --git a/.github/workflows/build_and_publish.yaml b/.github/workflows/build_and_publish.yaml index c7146e97..a5fff5c4 100644 --- a/.github/workflows/build_and_publish.yaml +++ b/.github/workflows/build_and_publish.yaml @@ -3,9 +3,9 @@ on: pull_request: push: branches: - - 'main' + - "main" tags: - - 'v*' + - "v*" release: types: - published diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 77538d9d..748e9667 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,14 +8,12 @@ on: # to the main branches and tags. push: branches: - - 'main' - - 'pre-commit-autoupdate' + - "main" + - "pre-commit-autoupdate" tags: - - 'v*' - + - "v*" jobs: - pre-commit-checks: name: Pre-commit Checks runs-on: ubuntu-latest @@ -29,21 +27,6 @@ jobs: - name: pre-commit run: pixi run pre-commit-run --color=always --show-diff-on-failure - mypy-type-checks: - name: Mypy Type Checks - runs-on: ubuntu-latest - steps: - - name: Checkout branch - uses: actions/checkout@v4 - - name: Set up pixi - uses: prefix-dev/setup-pixi@v0.8.1 - with: - environments: default lint - - name: mypy - run: | - pixi run -e mypy postinstall - pixi run -e mypy mypy . - unit-tests: name: "unit tests" strategy: @@ -168,7 +151,6 @@ jobs: file: ./coverage.xml token: ${{ secrets.CODECOV_TOKEN }} - db2: if: ${{ contains(github.event.pull_request.labels.*.name, 'db2') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }} name: DB2 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 139907a3..596d7df7 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,12 +13,12 @@ name: "CodeQL" on: push: - branches: [ "main", main_protection ] + branches: ["main", main_protection] pull_request: # The branches below must be a subset of the branches above - branches: [ "main" ] + branches: ["main"] schedule: - - cron: '16 4 * * 4' + - cron: "16 4 * * 4" jobs: analyze: @@ -32,45 +32,44 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'python' ] + language: ["python"] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Use only 'java' to analyze code written in Java, Kotlin or both # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4a02354a..a0f1db98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,28 +11,51 @@ repos: always_run: true require_serial: true pass_filenames: false - - id: black - name: black - entry: pixi run -e lint black + # ruff + - id: ruff + name: ruff + entry: pixi run -e lint ruff check --fix --exit-non-zero-on-fix --force-exclude language: system types_or: [python, pyi] require_serial: true - - id: flake8 - name: flake8 - entry: pixi run -e lint flake8 + - id: ruff-format + name: ruff-format + entry: pixi run -e lint ruff format --force-exclude language: system types_or: [python, pyi] require_serial: true - - id: pyupgrade - name: pyupgrade - entry: pixi run -e lint pyupgrade + # mypy + - id: mypy + name: mypy + entry: pixi run -e mypy mypy language: system - types: [python, pyi] - - id: isort - name: isort - entry: pixi run -e lint isort + types: [python] + require_serial: true + # prettier + - id: prettier + name: prettier + entry: pixi run -e lint prettier --write --list-different --ignore-unknown + language: system + types: [text] + files: \.(md|yml|yaml)$ + # taplo + - id: taplo + name: taplo + entry: pixi run -e lint taplo format + language: system + types: [toml] + # pre-commit-hooks + - id: trailing-whitespace-fixer + name: trailing-whitespace-fixer + entry: pixi run -e lint trailing-whitespace-fixer language: system - types: [python, pyi] + types: [text] + - id: end-of-file-fixer + name: end-of-file-fixer + entry: pixi run -e lint end-of-file-fixer + language: system + types: [text] + # typos - id: typos name: typos entry: pixi run -e lint typos --force-exclude @@ -40,8 +63,3 @@ repos: types: [text] exclude: "\\.csv$" require_serial: true - - id: taplo - name: taplo - entry: pixi run -e lint taplo format - language: system - types: [toml] diff --git a/.readthedocs.yml b/.readthedocs.yml index 583f0722..f2e6c0ae 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -11,5 +11,4 @@ build: sphinx: configuration: docs/source/conf.py formats: -- pdf - + - pdf diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3cfa838b..f331f168 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -130,4 +130,3 @@ Changelog **Bug fix:** - The method :meth:`is_deprecated` of :class:`~datajudge.Condition` was called despite not existing. - diff --git a/README.md b/README.md index f26a400e..4c54187e 100644 --- a/README.md +++ b/README.md @@ -31,5 +31,4 @@ companies_between_req = BetweenRequirement.from_tables( companies_between_req.add_row_superset_constraint( columns1=["name"], columns2=["name"], constant_max_missing_fraction=0 ) - ``` - +``` diff --git a/docs/source/examples/example_exploration.rst b/docs/source/examples/example_exploration.rst index 04ffaf99..cfee2734 100644 --- a/docs/source/examples/example_exploration.rst +++ b/docs/source/examples/example_exploration.rst @@ -241,5 +241,3 @@ could for instance be: Column 'col_varchar' has type 'varchar' in table1 and type 'varchar' in table2. Column 'col_int' has type 'integer' in table1 and type 'integer' in table2. - - diff --git a/docs/source/examples/twitch_report.html b/docs/source/examples/twitch_report.html index b8168a62..5f47c11e 100644 --- a/docs/source/examples/twitch_report.html +++ b/docs/source/examples/twitch_report.html @@ -342,4 +342,4 @@

Results

-
No log output captured.
\ No newline at end of file +
No log output captured.
diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 9c397b11..af41dc89 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -74,7 +74,7 @@ this growth limitation is expressed relative to the number of rows of the first Generally, such relative limitations can be defined in two ways: - manually, based on domain knowledge (e.g. 'at least 5% growth') - + - automatically, based on date ranges The former would translate to @@ -205,4 +205,3 @@ The Snowflake behavior is due to an upstream `bug =8.0.0 - - mypy_extensions >=0.4.3 - - packaging >=22.0 - - pathspec >=0.9 - - platformdirs >=2 - - python >=3.12,<3.13.0a0 - - python_abi 3.12.* *_cp312 - license: MIT - license_family: MIT - size: 407116 - timestamp: 1714120180643 -- kind: conda - name: black - version: 24.4.2 - build: py312h7900ff3_0 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/black-24.4.2-py312h7900ff3_0.conda - sha256: 02e36917e82adf0b2929b6fc35e60d7df224621c2d0b0c5ef819a4fb016e0742 - md5: 777e84c9bef7349c8cee65cffb11f7c4 - depends: - - click >=8.0.0 - - mypy_extensions >=0.4.3 - - packaging >=22.0 - - pathspec >=0.9 - - platformdirs >=2 - - python >=3.12,<3.13.0a0 - - python_abi 3.12.* *_cp312 - license: MIT - license_family: MIT - size: 387770 - timestamp: 1714119755759 -- kind: conda - name: black - version: 24.4.2 - build: py312h81bd7bf_0 - subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/black-24.4.2-py312h81bd7bf_0.conda - sha256: c78b125ad8e3492836524add8dd757489bf109363bb89ad9b6f86b64e5f6513b - md5: 696163f7d375e2bef948694129470337 - depends: - - click >=8.0.0 - - mypy_extensions >=0.4.3 - - packaging >=22.0 - - pathspec >=0.9 - - platformdirs >=2 - - python >=3.12,<3.13.0a0 - - python >=3.12,<3.13.0a0 *_cpython - - python_abi 3.12.* *_cp312 - license: MIT - license_family: MIT - size: 391658 - timestamp: 1714119953743 - kind: conda name: brotli-python version: 1.1.0 @@ -10303,39 +10241,6 @@ packages: license_family: MIT size: 46597 timestamp: 1698833765762 -- kind: conda - name: click - version: 8.1.7 - build: unix_pyh707e725_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/click-8.1.7-unix_pyh707e725_0.conda - sha256: f0016cbab6ac4138a429e28dbcb904a90305b34b3fe41a9b89d697c90401caec - md5: f3ad426304898027fc619827ff428eca - depends: - - __unix - - python >=3.8 - license: BSD-3-Clause - license_family: BSD - size: 84437 - timestamp: 1692311973840 -- kind: conda - name: click - version: 8.1.7 - build: win_pyh7428d3b_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/click-8.1.7-win_pyh7428d3b_0.conda - sha256: 90236b113b9a20041736e80b80ee965167f9aac0468315c55e2bad902d673fb0 - md5: 3549ecbceb6cd77b91a105511b7d0786 - depends: - - __win - - colorama - - python >=3.8 - license: BSD-3-Clause - license_family: BSD - size: 85051 - timestamp: 1692312207348 - kind: conda name: colorama version: 0.4.6 @@ -10754,6 +10659,23 @@ packages: license_family: APACHE size: 274915 timestamp: 1702383349284 +- kind: conda + name: docformatter + version: 1.7.5 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/docformatter-1.7.5-pyhd8ed1ab_0.conda + sha256: e6ec436da3615764106e16eb6bedfe6dc65d12de27e0bdb151dfdb39ec04d89e + md5: 3a941b6083e945aa87e739a9b85c82e9 + depends: + - charset-normalizer >=3.0.0 + - python >=3.7 + - untokenize >=0.1.1 + license: MIT + license_family: MIT + size: 28330 + timestamp: 1689652699366 - kind: conda name: docutils version: 0.20.1 @@ -10927,24 +10849,6 @@ packages: license: Unlicense size: 17592 timestamp: 1719088395353 -- kind: conda - name: flake8 - version: 7.1.0 - build: pyhd8ed1ab_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/flake8-7.1.0-pyhd8ed1ab_0.conda - sha256: 4b2d443b6ca80de9721a9ba8e56b99871081e85bf04244924855ced8c8a3924c - md5: 2bae9d19ae945a79d8bb32d3cab9109b - depends: - - mccabe >=0.7.0,<0.8.0 - - pycodestyle >=2.12.0,<2.13.0 - - pyflakes >=3.2.0,<3.3.0 - - python >=3.8.1 - license: MIT - license_family: MIT - size: 111018 - timestamp: 1718643627895 - kind: conda name: flit version: 3.9.0 @@ -12461,22 +12365,6 @@ packages: license_family: Proprietary size: 1851716 timestamp: 1719978332446 -- kind: conda - name: isort - version: 5.13.2 - build: pyhd8ed1ab_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/isort-5.13.2-pyhd8ed1ab_0.conda - sha256: 78a7e2037029366d2149f73c8d02e93cac903d535e208cc4517808b0b42e85f2 - md5: 1d25ed2b95b92b026aaa795eabec8d91 - depends: - - python >=3.8,<4.0 - - setuptools - license: MIT - license_family: MIT - size: 73783 - timestamp: 1702518633821 - kind: conda name: jinja2 version: 3.1.4 @@ -13875,6 +13763,32 @@ packages: license_family: BSD size: 33601 timestamp: 1680112270483 +- kind: conda + name: libuv + version: 1.48.0 + build: h93a5062_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libuv-1.48.0-h93a5062_0.conda + sha256: 60bed2a7a85096387ab0381cbc32ea2da7f8dd99bd90e440983019c0cdd96ad1 + md5: abfd49e80f13453b62a56be226120ea8 + license: MIT + license_family: MIT + size: 405988 + timestamp: 1709913494015 +- kind: conda + name: libuv + version: 1.48.0 + build: hd590300_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libuv-1.48.0-hd590300_0.conda + sha256: b7c0e8a0c93c2621be7645b37123d4e8d27e8a974da26a3fba47a9c37711aa7f + md5: 7e8b914b1062dd4386e3de4d82a3ead6 + depends: + - libgcc-ng >=12 + license: MIT + license_family: MIT + size: 899979 + timestamp: 1709913354710 - kind: conda name: libxcrypt version: 4.4.36 @@ -14395,21 +14309,6 @@ packages: license_family: BSD size: 24314 timestamp: 1706900151453 -- kind: conda - name: mccabe - version: 0.7.0 - build: pyhd8ed1ab_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/mccabe-0.7.0-pyhd8ed1ab_0.tar.bz2 - sha256: 0466ad9490b761e9a8c57fab574fc099136b45fa19a0746ce33acdeb2a84766b - md5: 34fc335fc50eef0b5ea708f2b5f54e0c - depends: - - python >=3.6 - license: MIT - license_family: MIT - size: 10909 - timestamp: 1643049714491 - kind: conda name: mdurl version: 0.1.2 @@ -14901,6 +14800,58 @@ packages: license_family: BSD size: 34489 timestamp: 1717585382642 +- kind: conda + name: nodejs + version: 20.12.2 + build: h3b52c9b_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/nodejs-20.12.2-h3b52c9b_0.conda + sha256: 81ea2a695b4b97ce6066220b9e54232e67b4a1e3eac3fc7016c08a463c588478 + md5: 0ba66fae46df4a035db42e2230453604 + depends: + - icu >=73.2,<74.0a0 + - libcxx >=16 + - libuv >=1.48.0,<1.49.0a0 + - libzlib >=1.2.13,<2.0.0a0 + - openssl >=3.2.1,<4.0a0 + - zlib + license: MIT + license_family: MIT + size: 11674337 + timestamp: 1714140786813 +- kind: conda + name: nodejs + version: 20.12.2 + build: h57928b3_0 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/nodejs-20.12.2-h57928b3_0.conda + sha256: 31b275bf914d57941e818b31f7ee8367c6c6a8532a2918639c87816bad1323af + md5: 28d4536e0beff7b51232a5b16f9c3444 + license: MIT + license_family: MIT + size: 22693430 + timestamp: 1714121518826 +- kind: conda + name: nodejs + version: 20.12.2 + build: hb753e55_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/nodejs-20.12.2-hb753e55_0.conda + sha256: 2f5813d9718963861314c6d9f75fe4630c3e6d078ec1e792770daf9ce7ac5c4f + md5: 1fd16ca757a195c4357a1fbb2cb553b5 + depends: + - __glibc >=2.17,<3.0.a0 + - icu >=73.2,<74.0a0 + - libgcc-ng >=12 + - libstdcxx-ng >=12 + - libuv >=1.48.0,<1.49.0a0 + - libzlib >=1.2.13,<2.0.0a0 + - openssl >=3.2.1,<4.0a0 + - zlib + license: MIT + license_family: MIT + size: 17183636 + timestamp: 1714128011970 - kind: conda name: numpy version: 1.24.4 @@ -15363,21 +15314,6 @@ packages: license_family: BSD size: 97949 timestamp: 1717510726829 -- kind: conda - name: pathspec - version: 0.12.1 - build: pyhd8ed1ab_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/pathspec-0.12.1-pyhd8ed1ab_0.conda - sha256: 4e534e66bfe8b1e035d2169d0e5b185450546b17e36764272863e22e0370be4d - md5: 17064acba08d3686f1135b5ec1b32b12 - depends: - - python >=3.7 - license: MPL-2.0 - license_family: MOZILLA - size: 41173 - timestamp: 1702250135032 - kind: conda name: pbr version: 6.0.0 @@ -15491,6 +15427,70 @@ packages: license_family: MIT size: 179748 timestamp: 1715432871404 +- kind: conda + name: pre-commit-hooks + version: 4.6.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pre-commit-hooks-4.6.0-pyhd8ed1ab_0.conda + sha256: 2d4a57474c7e2b90cc301df6197207d0812753279b2a7fae88106e0adc5d0b21 + md5: 9b353c467bcabf27ab5bae2e319c16bf + depends: + - python >=3.6 + - ruamel.yaml >=0.15 + - tomli >=1.1.0 + license: MIT + license_family: MIT + size: 34686 + timestamp: 1712432480698 +- kind: conda + name: prettier + version: 3.3.2 + build: h91d9761_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/prettier-3.3.2-h91d9761_0.conda + sha256: a6771f2eb46d4b2e3dabb95bb10eb0329dc8c931915c0814d51c30da4f1873b7 + md5: debb8690a064cb4e1dfa37e9fb633cdc + depends: + - __glibc >=2.17,<3.0.a0 + - nodejs >=20.12.2,<21.0a0 + license: MIT + license_family: MIT + size: 981161 + timestamp: 1719500715648 +- kind: conda + name: prettier + version: 3.3.2 + build: hb4d2b26_0 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/prettier-3.3.2-hb4d2b26_0.conda + sha256: fadc57b819f374a306c6e74e9feed3a1d0fd8d41935ae69ef541b123f2f503cc + md5: 8275544720cf799694b59c161081cde5 + depends: + - nodejs >=20.12.2,<21.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.40.33810 + license: MIT + license_family: MIT + size: 982844 + timestamp: 1719501070274 +- kind: conda + name: prettier + version: 3.3.2 + build: he434342_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/prettier-3.3.2-he434342_0.conda + sha256: 4e1a09d00ab25e9c4c4523e30372e716bc0944526eba842750aaec82281ec254 + md5: bd4a21dcc59c3de207de6621714e445d + depends: + - __osx >=11.0 + - nodejs >=20.12.2,<21.0a0 + license: MIT + license_family: MIT + size: 978822 + timestamp: 1719500784621 - kind: conda name: proto-plus version: 1.23.0 @@ -16021,21 +16021,6 @@ packages: license_family: BSD size: 95671 timestamp: 1713209827505 -- kind: conda - name: pycodestyle - version: 2.12.0 - build: pyhd8ed1ab_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/pycodestyle-2.12.0-pyhd8ed1ab_0.conda - sha256: 72dab6a6e9e59d0cfb24f540c2095e844a621d397832f9f38599704a74b65ae9 - md5: b9cc97b824a995fb231c377f61881bf8 - depends: - - python >=3.8 - license: MIT - license_family: MIT - size: 34439 - timestamp: 1718525120407 - kind: conda name: pycparser version: '2.22' @@ -16051,21 +16036,6 @@ packages: license_family: BSD size: 105098 timestamp: 1711811634025 -- kind: conda - name: pyflakes - version: 3.2.0 - build: pyhd8ed1ab_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/pyflakes-3.2.0-pyhd8ed1ab_0.conda - sha256: b1582410fcfa30b3597629e39b688ead87833c4a64f7c4637068f80aa1411d49 - md5: 0cf7fef6aa123df28adb21a590065e3d - depends: - - python ==2.7.*|>=3.5 - license: MIT - license_family: MIT - size: 58654 - timestamp: 1704424729210 - kind: conda name: pygments version: 2.18.0 @@ -17161,22 +17131,6 @@ packages: license_family: APACHE size: 31876 timestamp: 1604249020971 -- kind: conda - name: pyupgrade - version: 3.16.0 - build: pyhd8ed1ab_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/pyupgrade-3.16.0-pyhd8ed1ab_0.conda - sha256: 92cc9c20da14657ae81879844a9472068823e521186dae92e1b65b57d1677457 - md5: 6e39377d5bfc93d087d598998d6758c9 - depends: - - python >=3.8.1 - - tokenize-rt >=5.2.0 - license: MIT - license_family: MIT - size: 45519 - timestamp: 1717886806029 - kind: conda name: pyyaml version: 6.0.1 @@ -17364,6 +17318,164 @@ packages: license_family: APACHE size: 29863 timestamp: 1658329024970 +- kind: conda + name: ruamel.yaml + version: 0.18.6 + build: py312h98912ed_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/ruamel.yaml-0.18.6-py312h98912ed_0.conda + sha256: 26856daba883254736b7f3767c08f445b5d010eebbf4fc7aa384ee80e24aa663 + md5: a99a06a875138829ef65f44bbe2c30ca + depends: + - libgcc-ng >=12 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ruamel.yaml.clib >=0.1.2 + license: MIT + license_family: MIT + size: 268015 + timestamp: 1707298336196 +- kind: conda + name: ruamel.yaml + version: 0.18.6 + build: py312he37b823_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/ruamel.yaml-0.18.6-py312he37b823_0.conda + sha256: 4a27b50445842e97a31e3f412816d4a0d576b4f1ee327b9a892a183ba5c60f6f + md5: cb9f9b4797001b2c52383f4007fa1f4b + depends: + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + - ruamel.yaml.clib >=0.1.2 + license: MIT + license_family: MIT + size: 268637 + timestamp: 1707298502612 +- kind: conda + name: ruamel.yaml + version: 0.18.6 + build: py312he70551f_0 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/ruamel.yaml-0.18.6-py312he70551f_0.conda + sha256: 31a9e347107a46149ae334586430bebb3a769bb5792eba9ccb89c664dbce7970 + md5: 5833ba75a49ac40876242ccb5f77ab23 + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ruamel.yaml.clib >=0.1.2 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: MIT + license_family: MIT + size: 267762 + timestamp: 1707298539404 +- kind: conda + name: ruamel.yaml.clib + version: 0.2.8 + build: py312h98912ed_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/ruamel.yaml.clib-0.2.8-py312h98912ed_0.conda + sha256: 5965302881d8b1049291e3ba3912286cdc72cb82303230cbbf0a048c6f6dd7c1 + md5: 05f31c2a79ba61df8d6d903ce4a4ce7b + depends: + - libgcc-ng >=12 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + size: 135640 + timestamp: 1707314642857 +- kind: conda + name: ruamel.yaml.clib + version: 0.2.8 + build: py312he37b823_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/ruamel.yaml.clib-0.2.8-py312he37b823_0.conda + sha256: c3138824f484cca2804d22758c75965b578cd35b35243ff02e64da06bda03477 + md5: 2fa02324046cfcb7a67fae30fd06a945 + depends: + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + size: 111221 + timestamp: 1707315016121 +- kind: conda + name: ruamel.yaml.clib + version: 0.2.8 + build: py312he70551f_0 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/ruamel.yaml.clib-0.2.8-py312he70551f_0.conda + sha256: 7d5705ee3190a5b1c24eee2def964cc1d70b9e856488d971f0fd6df0224ca666 + md5: f8de34a829b65a8e3ac6ddc61ed0d2e0 + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: MIT + license_family: MIT + size: 96333 + timestamp: 1707315306489 +- kind: conda + name: ruff + version: 0.5.0 + build: py312h3402d49_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/ruff-0.5.0-py312h3402d49_0.conda + sha256: 892bc1d657d968add563fe575c6ad23c26789951e9938bc909decbb4f7ac1281 + md5: ace8c1e4063d6342a25b71549bd73d70 + depends: + - __osx >=11.0 + - libcxx >=16 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + constrains: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 5806556 + timestamp: 1719519029730 +- kind: conda + name: ruff + version: 0.5.0 + build: py312h5715c7c_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/ruff-0.5.0-py312h5715c7c_0.conda + sha256: 554395f223695edee3a5a30982450e43a00875603ce285f93b83cd9446393f3e + md5: bf1f6174cb87833cfe8a007a4993aef7 + depends: + - libgcc-ng >=12 + - libstdcxx-ng >=12 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + size: 6372319 + timestamp: 1719518575715 +- kind: conda + name: ruff + version: 0.5.0 + build: py312h7a6832a_0 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/ruff-0.5.0-py312h7a6832a_0.conda + sha256: 5fb99ba6949728a739e3ea5a3e60247402d8bddc59ebed7861de889c0da419aa + md5: 8c7fb0af1743df8c579350d3edf9e744 + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: MIT + license_family: MIT + size: 6209714 + timestamp: 1719519712891 - kind: conda name: scipy version: 1.10.1 @@ -19011,22 +19123,6 @@ packages: license_family: BSD size: 3318875 timestamp: 1699202167581 -- kind: conda - name: tokenize-rt - version: 5.2.0 - build: pyhd8ed1ab_1 - build_number: 1 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/tokenize-rt-5.2.0-pyhd8ed1ab_1.conda - sha256: 718ef94c692e1ac92ad592578be3046e97045d29ada024795e25f220d1eac850 - md5: 06d871f357861ca882b37aa295f66b27 - depends: - - python >=3.8 - license: MIT - license_family: MIT - size: 11779 - timestamp: 1705356409158 - kind: conda name: toml version: 0.10.2 @@ -19351,6 +19447,21 @@ packages: license: LGPL-2.1 size: 281830 timestamp: 1691504075258 +- kind: conda + name: untokenize + version: 0.1.1 + build: py_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/untokenize-0.1.1-py_0.tar.bz2 + sha256: 38ac6f277f228e8b79a0707a85a86971e4c73dc6b4483c2286cfb413f0b62b58 + md5: 1447ead40f2a01733a9c8dfc32988375 + depends: + - python + license: MIT + license_family: MIT + size: 6143 + timestamp: 1583436833181 - kind: conda name: urllib3 version: 1.26.19 @@ -19696,6 +19807,38 @@ packages: license_family: MIT size: 20917 timestamp: 1718013395428 +- kind: conda + name: zlib + version: 1.3.1 + build: h4ab18f5_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-h4ab18f5_1.conda + sha256: cee16ab07a11303de721915f0a269e8c7a54a5c834aa52f74b1cc3a59000ade8 + md5: 9653f1bf3766164d0e65fa723cabbc54 + depends: + - libgcc-ng >=12 + - libzlib 1.3.1 h4ab18f5_1 + license: Zlib + license_family: Other + size: 93004 + timestamp: 1716874213487 +- kind: conda + name: zlib + version: 1.3.1 + build: hfb2fe0b_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/zlib-1.3.1-hfb2fe0b_1.conda + sha256: 87360c2dc662916aac37cf01e53324b4f4f78db6f399220818076752b093ede5 + md5: f27e021db7862b6ddbc1d3578f10d883 + depends: + - __osx >=11.0 + - libzlib 1.3.1 hfb2fe0b_1 + license: Zlib + license_family: Other + size: 78260 + timestamp: 1716874280334 - kind: conda name: zstandard version: 0.22.0 diff --git a/pixi.toml b/pixi.toml index 32158dff..ea046919 100644 --- a/pixi.toml +++ b/pixi.toml @@ -101,12 +101,12 @@ types-jinja2 = "*" [feature.lint.dependencies] pre-commit = "*" -black = "*" -flake8 = "*" -isort = "*" +docformatter = "*" +ruff = "*" +prettier = "*" taplo = "*" +pre-commit-hooks = "*" typos = "*" -pyupgrade = "*" [feature.lint.tasks] pre-commit-install = "pre-commit install" diff --git a/pyproject.toml b/pyproject.toml index 875f16cd..a0f3ec48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,35 +17,45 @@ classifiers = [ ] readme = "README.md" dynamic = ["version", "description"] - -requires-python = ">=3.8.0" +requires-python = ">=3.8" dependencies = ["sqlalchemy >=1.4", "setuptools", "scipy", "colorama"] [project.urls] Source = "https://github.com/quantco/datajudge" -[tool.black] -exclude = ''' -/( - \.eggs - | \.git - | \.venv - | build - | dist -)/ -''' - -[tool.isort] -multi_line_output = 3 -include_trailing_comma = true -ensure_newline_before_comments = true -line_length = 88 -known_first_party = "datajudge" -skip_glob = '\.eggs/*,\.git/*,\.venv/*,build/*,dist/*' -default_section = 'THIRDPARTY' +[tool.ruff] +line-length = 88 + +[tool.ruff.lint] +ignore = [ + "N803", # https://docs.astral.sh/ruff/rules/invalid-argument-name + "N806", # https://docs.astral.sh/ruff/rules/non-lowercase-variable-in-function + "E501", # https://docs.astral.sh/ruff/faq/#is-the-ruff-linter-compatible-with-black +] +select = [ + # pyflakes + "F", + # pycodestyle + "E", + "W", + # isort + "I", + # pep8-naming + "N", + # pyupgrade + "UP", +] + +[tool.ruff.lint.isort] +known-first-party = ["datajudge"] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" [tool.mypy] +python_version = '3.8' no_implicit_optional = true allow_empty_bodies = true check_untyped_defs = true diff --git a/run_integration_tests_postgres.sh b/run_integration_tests_postgres.sh index 24d5a1bc..46bf5412 100755 --- a/run_integration_tests_postgres.sh +++ b/run_integration_tests_postgres.sh @@ -3,7 +3,7 @@ docker stop $(docker ps -q --filter name=postgres_datajudge) ./start_postgres.sh & -bash -c "while true; do printf '\nPress enter once postgres is ready: '; sleep 1; done" & +bash -c "while true; do printf '\nPress enter once postgres is ready: '; sleep 1; done" & read -p "Press enter to once postgres is ready: " kill %% @@ -11,4 +11,3 @@ kill %% echo "STARTING PYTEST" pixi run -e postgres-py38 test $@ docker stop $(docker ps -q --filter name=postgres_datajudge) - diff --git a/src/datajudge/constraints/uniques.py b/src/datajudge/constraints/uniques.py index 5784749a..5319a823 100644 --- a/src/datajudge/constraints/uniques.py +++ b/src/datajudge/constraints/uniques.py @@ -230,8 +230,9 @@ def compare( and (relative_violations := (n_violations / n_rows)) > self.max_relative_violations ): - output_elemes, output_counts = list(remainder.keys()), list( - remainder.values() + output_elemes, output_counts = ( + list(remainder.keys()), + list(remainder.values()), ) if self.output_processors is not None: for output_processor in self.output_processors: diff --git a/src/datajudge/constraints/varchar.py b/src/datajudge/constraints/varchar.py index 7651b39f..7d016d2a 100644 --- a/src/datajudge/constraints/varchar.py +++ b/src/datajudge/constraints/varchar.py @@ -32,9 +32,12 @@ def __init__( def retrieve(self, engine: sa.engine.Engine, ref: DataReference): ( - n_violations, - counterexamples, - ), violations_selections = db_access.get_regex_violations( + ( + n_violations, + counterexamples, + ), + violations_selections, + ) = db_access.get_regex_violations( engine=engine, ref=ref, aggregated=self.aggregated, @@ -114,7 +117,9 @@ def test(self, engine: sa.engine.Engine) -> TestResult: pattern = re.compile(self.ref_value) uniques_mismatching = { - x for x in uniques_factual if not pattern.match(x) # type: ignore + x + for x in uniques_factual + if not pattern.match(x) # type: ignore } if self.aggregated: diff --git a/src/datajudge/utils.py b/src/datajudge/utils.py index cd4fd238..ad47607f 100644 --- a/src/datajudge/utils.py +++ b/src/datajudge/utils.py @@ -173,7 +173,7 @@ def sort_tuple_none_aware( # if all entries are None, just use a constant int() == 0 dtypes_each_tupleelement[dtypeidx] = int - def replace_None_with_default(elem): + def replace_None_with_default(elem): # noqa: N802 return tuple( ((dtype() if dtype else None) if subelem is None else subelem) for dtype, subelem in zip(dtypes_each_tupleelement, elem)