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 @@