From 034a38941c102160381581f05ef621e3e03d0630 Mon Sep 17 00:00:00 2001 From: adnaniazi Date: Sat, 10 Aug 2024 00:37:20 +0000 Subject: [PATCH] chore: update project structure to b25684a2 --- .cruft.json | 2 +- .../actions/python-poetry-env/action.yml.rej | 16 +++ .github/workflows/cookiecutter.yml.rej | 16 +++ .github/workflows/dependencies.yml | 2 +- .github/workflows/draft_release.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 6 +- .github/workflows/test.yml.rej | 21 +++ .pre-commit-config.yaml | 5 - .pre-commit-config.yaml.rej | 43 ++++++ LICENCE => LICENSE | 0 LICENSE.rej | 9 ++ README.md.rej | 31 +++++ mkdocs.yml.rej | 12 ++ poetry.lock | 8 +- pyproject.toml.rej | 124 ++++++++++++++++++ src/capfinder/cli.py | 1 + 17 files changed, 286 insertions(+), 14 deletions(-) create mode 100644 .github/actions/python-poetry-env/action.yml.rej create mode 100644 .github/workflows/cookiecutter.yml.rej create mode 100644 .github/workflows/test.yml.rej create mode 100644 .pre-commit-config.yaml.rej rename LICENCE => LICENSE (100%) create mode 100644 LICENSE.rej create mode 100644 README.md.rej create mode 100644 mkdocs.yml.rej create mode 100644 pyproject.toml.rej diff --git a/.cruft.json b/.cruft.json index 40cbfcc..1a59ea6 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/woltapp/wolt-python-package-cookiecutter", - "commit": "4eecc9c4d27e3c9321438bc1fdaf717bec5eadf6", + "commit": "b25684a2c63387153b83a1cc03ea332be8c8279a", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/actions/python-poetry-env/action.yml.rej b/.github/actions/python-poetry-env/action.yml.rej new file mode 100644 index 0000000..35a35ba --- /dev/null +++ b/.github/actions/python-poetry-env/action.yml.rej @@ -0,0 +1,16 @@ +diff a/.github/actions/python-poetry-env/action.yml b/.github/actions/python-poetry-env/action.yml (rejected hunks) +@@ -5,12 +5,12 @@ inputs: + python-version: + required: false + description: 'Python version' +- default: '3.10' ++ default: '3.12' + outputs: {} + runs: + using: 'composite' + steps: +- - uses: actions/setup-python@v4 ++ - uses: actions/setup-python@v5 + with: + python-version: ${{inputs.python-version}} + - name: Install poetry diff --git a/.github/workflows/cookiecutter.yml.rej b/.github/workflows/cookiecutter.yml.rej new file mode 100644 index 0000000..82fa337 --- /dev/null +++ b/.github/workflows/cookiecutter.yml.rej @@ -0,0 +1,16 @@ +diff a/.github/workflows/cookiecutter.yml b/.github/workflows/cookiecutter.yml (rejected hunks) +@@ -8,11 +8,11 @@ jobs: + auto-update-project: + runs-on: ubuntu-latest + steps: +- - uses: actions/checkout@v2 ++ - uses: actions/checkout@v4 + - name: Set up Python +- uses: actions/setup-python@v4 ++ uses: actions/setup-python@v5 + with: +- python-version: 3.9 ++ python-version: "3.12" + + - name: Install dependencies + run: python -m pip install cruft poetry jello tabulate diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index f7a6f51..a657d27 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -8,7 +8,7 @@ jobs: auto-update-dependencies: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/actions/python-poetry-env - name: Install tabulate diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 9f8b0f3..5729bf4 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -12,7 +12,7 @@ jobs: draft-release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/actions/python-poetry-env - name: Update version id: updated_version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09929d4..070b134 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/actions/python-poetry-env - name: Publish to pypi run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de323a0..c8208c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: actionlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Download actionlint run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.21 shell: bash @@ -22,14 +22,14 @@ jobs: name: Check if automatic project update was successful runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Fail if .rej files exist as structure update was not successful run: test -z "$(find . -iname '*.rej')" pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/actions/python-poetry-env - run: poetry run pre-commit run --all-files diff --git a/.github/workflows/test.yml.rej b/.github/workflows/test.yml.rej new file mode 100644 index 0000000..2b17ffd --- /dev/null +++ b/.github/workflows/test.yml.rej @@ -0,0 +1,21 @@ +diff a/.github/workflows/test.yml b/.github/workflows/test.yml (rejected hunks) +@@ -38,10 +38,17 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.7", "3.8", "3.9", "3.10"] ++ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: +- - uses: actions/checkout@v2 ++ - uses: actions/checkout@v4 + - uses: ./.github/actions/python-poetry-env + with: + python-version: ${{ matrix.python-version }} + - run: poetry run pytest ++ ++ docs: ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: ./.github/actions/python-poetry-env ++ - run: poetry run mkdocs build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8a3582f..f24302f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,11 +43,6 @@ repos: language: system types: [python] pass_filenames: false - - id: flake8 - name: flake8 - entry: poetry run flake8 - language: system - types: [python] - id: kacl-verify name: kacl-verify entry: poetry run kacl-cli verify diff --git a/.pre-commit-config.yaml.rej b/.pre-commit-config.yaml.rej new file mode 100644 index 0000000..4721388 --- /dev/null +++ b/.pre-commit-config.yaml.rej @@ -0,0 +1,43 @@ +diff a/.pre-commit-config.yaml b/.pre-commit-config.yaml (rejected hunks) +@@ -11,30 +11,24 @@ repos: + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer ++ exclude: 'CHANGELOG.md' + - id: trailing-whitespace + - id: mixed-line-ending + - repo: local + hooks: +- - id: autoflake +- name: autoflake +- entry: poetry run autoflake -r -i --remove-all-unused-imports --remove-unused-variables ++ - id: ruff-format ++ name: ruff-format ++ entry: poetry run ruff format ++ require_serial: true + language: system + types: [ python ] +- - id: isort +- name: isort +- entry: poetry run isort +- language: system +- types: [python] +- - id: black +- name: black +- entry: poetry run black +- language: system +- types: [python] +- - id: pyupgrade +- name: pyupgrade +- entry: poetry run pyupgrade --py37-plus ++ - id: ruff ++ name: ruff ++ # Add --fix, in case you want it to autofix when this hook runs ++ entry: poetry run ruff check --force-exclude ++ require_serial: true + language: system +- types: [python] ++ types: [ python ] + - id: mypy + name: mypy + entry: poetry run mypy . diff --git a/LICENCE b/LICENSE similarity index 100% rename from LICENCE rename to LICENSE diff --git a/LICENSE.rej b/LICENSE.rej new file mode 100644 index 0000000..fada1f2 --- /dev/null +++ b/LICENSE.rej @@ -0,0 +1,9 @@ +diff a/LICENSE b/LICENSE (rejected hunks) +@@ -1,6 +1,6 @@ + The MIT License (MIT) + +-Copyright (c) 2021 Adnan M. Niazi ++Copyright (c) 2024 Adnan M. Niazi + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in diff --git a/README.md.rej b/README.md.rej new file mode 100644 index 0000000..06c1b7e --- /dev/null +++ b/README.md.rej @@ -0,0 +1,31 @@ +diff a/README.md b/README.md (rejected hunks) +@@ -29,7 +29,7 @@ pip install capfinder + * Clone this repository + * Requirements: + * [Poetry](https://python-poetry.org/) +- * Python 3.7+ ++ * Python 3.8+ + * Create a virtual environment and install the dependencies + + ```sh +@@ -50,9 +50,8 @@ pytest + + ### Documentation + +-The documentation is automatically generated from the content of the [docs directory](./docs) and from the docstrings +- of the public signatures of the source code. The documentation is updated and published as a [Github project page +- ](https://pages.github.com/) automatically as part each release. ++The documentation is automatically generated from the content of the [docs directory](https://github.com/adnaniazi/capfinder/tree/master/docs) and from the docstrings ++ of the public signatures of the source code. The documentation is updated and published as a [Github Pages page](https://pages.github.com/) automatically as part each release. + + ### Releasing + +@@ -66,7 +65,7 @@ Find the draft release from the + + ### Pre-commit + +-Pre-commit hooks run all the auto-formatters (e.g. `black`, `isort`), linters (e.g. `mypy`, `flake8`), and other quality ++Pre-commit hooks run all the auto-formatting (`ruff format`), linters (e.g. `ruff` and `mypy`), and other quality + checks to make sure the changeset is in good shape before a commit/push happens. + + You can install the hooks with (runs for each commit): diff --git a/mkdocs.yml.rej b/mkdocs.yml.rej new file mode 100644 index 0000000..937c754 --- /dev/null +++ b/mkdocs.yml.rej @@ -0,0 +1,12 @@ +diff a/mkdocs.yml b/mkdocs.yml (rejected hunks) +@@ -28,9 +28,7 @@ plugins: + default_handler: python + handlers: + python: +- rendering: ++ options: + show_signature_annotations: true + show_source: true + show_submodules: true +- watch: +- - src/capfinder diff --git a/poetry.lock b/poetry.lock index d80f95f..0392065 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1393,6 +1393,7 @@ description = "Python AST that abstracts the underlying Python version" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ + {file = "gast-0.6.0-py3-none-any.whl", hash = "sha256:52b182313f7330389f72b069ba00f174cfe2a06411099547288839c6cbafbd54"}, {file = "gast-0.6.0.tar.gz", hash = "sha256:88fc5300d32c7ac6ca7b515310862f71e6fdf2c029bbec7c66c0f5dd47b6b1fb"}, ] @@ -2350,6 +2351,7 @@ description = "Clang Python Bindings, mirrored from the official LLVM repo: http optional = false python-versions = "*" files = [ + {file = "libclang-18.1.1-1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:0b2e143f0fac830156feb56f9231ff8338c20aecfe72b4ffe96f19e5a1dbb69a"}, {file = "libclang-18.1.1-py2.py3-none-macosx_10_9_x86_64.whl", hash = "sha256:6f14c3f194704e5d09769108f03185fce7acaf1d1ae4bbb2f30a72c2400cb7c5"}, {file = "libclang-18.1.1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:83ce5045d101b669ac38e6da8e58765f12da2d3aafb3b9b98d88b286a60964d8"}, {file = "libclang-18.1.1-py2.py3-none-manylinux2010_x86_64.whl", hash = "sha256:c533091d8a3bbf7460a00cb6c1a71da93bffe148f172c7d03b1c31fbf8aa2a0b"}, @@ -2775,8 +2777,8 @@ files = [ [package.dependencies] numpy = [ {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, - {version = ">=1.21.2", markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, {version = ">=1.23.3", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=1.21.2", markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, ] [package.extras] @@ -3165,6 +3167,8 @@ files = [ {file = "orjson-3.10.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:960db0e31c4e52fa0fc3ecbaea5b2d3b58f379e32a95ae6b0ebeaa25b93dfd34"}, {file = "orjson-3.10.6-cp312-none-win32.whl", hash = "sha256:a6ea7afb5b30b2317e0bee03c8d34c8181bc5a36f2afd4d0952f378972c4efd5"}, {file = "orjson-3.10.6-cp312-none-win_amd64.whl", hash = "sha256:874ce88264b7e655dde4aeaacdc8fd772a7962faadfb41abe63e2a4861abc3dc"}, + {file = "orjson-3.10.6-cp313-none-win32.whl", hash = "sha256:efdf2c5cde290ae6b83095f03119bdc00303d7a03b42b16c54517baa3c4ca3d0"}, + {file = "orjson-3.10.6-cp313-none-win_amd64.whl", hash = "sha256:8e190fe7888e2e4392f52cafb9626113ba135ef53aacc65cd13109eb9746c43e"}, {file = "orjson-3.10.6-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:66680eae4c4e7fc193d91cfc1353ad6d01b4801ae9b5314f17e11ba55e934183"}, {file = "orjson-3.10.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:caff75b425db5ef8e8f23af93c80f072f97b4fb3afd4af44482905c9f588da28"}, {file = "orjson-3.10.6-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3722fddb821b6036fd2a3c814f6bd9b57a89dc6337b9924ecd614ebce3271394"}, @@ -3250,8 +3254,8 @@ files = [ [package.dependencies] numpy = [ {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, - {version = ">=1.22.4", markers = "python_version < \"3.11\""}, {version = ">=1.23.2", markers = "python_version == \"3.11\""}, + {version = ">=1.22.4", markers = "python_version < \"3.11\""}, ] python-dateutil = ">=2.8.2" pytz = ">=2020.1" diff --git a/pyproject.toml.rej b/pyproject.toml.rej new file mode 100644 index 0000000..56a1699 --- /dev/null +++ b/pyproject.toml.rej @@ -0,0 +1,124 @@ +diff a/pyproject.toml b/pyproject.toml (rejected hunks) +@@ -18,9 +18,11 @@ classifiers = [ + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", +- "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ++ "Programming Language :: Python :: 3.10", ++ "Programming Language :: Python :: 3.11", ++ "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed", + ] +@@ -30,43 +32,54 @@ packages = [ + ] + + [tool.poetry.dependencies] +-python = ">=3.7.1, <4.0" +- +-[tool.poetry.dev-dependencies] +-autoflake = "*" +-black = "*" +-flake8 = "*" +-flake8-bugbear = "*" +-flake8-builtins = "*" +-flake8-comprehensions = "*" +-flake8-debugger = "*" +-flake8-eradicate = "*" +-flake8-logging-format = "*" +-isort = "*" +-mkdocstrings = {version = ">=0.18", extras = ["python"]} ++python = ">=3.8.1, <4.0" ++ ++[tool.poetry.group.dev.dependencies] ++mkdocstrings = {version = ">=0.23", extras = ["python"]} + mkdocs-material = "*" + mypy = "*" +-pep8-naming = "*" + pre-commit = "*" + pymdown-extensions = "*" + pytest = "*" + pytest-github-actions-annotate-failures = "*" + pytest-cov = "*" + python-kacl = "*" +-pyupgrade = "*" +-tryceratops = "*" ++ruff = ">=0.2.0" + + [build-system] + requires = ["poetry-core>=1.0.0"] + build-backend = "poetry.core.masonry.api" + +-[tool.isort] +-profile = "black" +-src_paths = ["src", "tests"] ++[tool.ruff] ++target-version = "py38" # The lowest supported version ++ ++[tool.ruff.lint] ++# By default, enable all the lint rules. ++# Add to the ignore list below if you don't want some rules. ++# If you need some ignores for certain modules, see tool.ruff.lint.per-file-ignores below. ++# For individual ignore cases, prefer inline `# noqa`s within the code. ++select = ["ALL"] ++ignore = [ ++ "ANN", # Type hints related, let mypy handle these. ++ "D", # Docstrings related, way too strict to our taste ++ ] ++ ++[tool.ruff.lint.per-file-ignores] ++"tests/**" = [ ++ "S101", # "Use of `assert` detected" ++ "ARG", # "Unused function argument". Fixtures are often unused. ++ "S105", # "Possible hardcoded password". ++] ++ ++[tool.ruff.lint.mccabe] ++max-complexity = 10 + +-[tool.black] +-target-version = ["py37", "py38", "py39"] +-include = '\.pyi?$' ++[tool.ruff.lint.pep8-naming] ++classmethod-decorators = [ ++ "classmethod", ++ "pydantic.validator", ++ "pydantic.root_validator", ++] + + [tool.pytest.ini_options] + addopts = """\ +@@ -84,12 +97,23 @@ exclude_lines = [ + ] + + [tool.mypy] ++# This is the global mypy configuration. ++# Avoid changing this! ++strict = true # See all the enabled flags `mypy --help | grep -A 10 'Strict mode'` + disallow_any_unimported = true +-disallow_untyped_defs = true +-no_implicit_optional = true +-strict_equality = true +-warn_unused_ignores = true +-warn_redundant_casts = true +-warn_return_any = true +-check_untyped_defs = true +-show_error_codes = true ++ ++# If you need to ignore something for some specific module, ++# add overrides for them. Avoid changing the global config! ++# For example: ++# [[tool.mypy.overrides]] ++# module = [ ++# "my_unpyted_dependency1.*", ++# "my_unpyted_dependency2.*" ++# ] ++# ignore_missing_imports = true ++ ++# [[tool.mypy.overrides]] ++# module = [ ++# "tests/my_thing/test_my_thing", ++# ] ++# disallow_untyped_defs = false diff --git a/src/capfinder/cli.py b/src/capfinder/cli.py index 73e8503..49ade18 100644 --- a/src/capfinder/cli.py +++ b/src/capfinder/cli.py @@ -229,6 +229,7 @@ def extract_cap_signal( \u200B ├── good_reads: Directory that contains the plots for the good reads.\n \u200B ├── bad_reads: Directory that contains the plots for the bad reads.\n \u200B └── plotpaths.csv: CSV file containing the paths to the plots based on the read ID.\n""" + ), ), ] = "",