-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix import and formatting issues in multiple files (#11)
* Fix import and formatting issues in multiple files * updates * style(pre-commit.ci): auto fixes [...] * unsafe fixes * upda * fix test --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e68b9b5
commit ae759e9
Showing
25 changed files
with
180 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,18 @@ on: | |
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
# run every week (for --pre release tests) | ||
- cron: "0 0 * * 0" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-manifest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- run: pipx run check-manifest | ||
|
||
test: | ||
|
@@ -24,16 +29,11 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 🐍 Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
|
@@ -51,7 +51,6 @@ jobs: | |
- name: 🧪 Run Tests | ||
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing | ||
|
||
# If something goes wrong with --pre tests, we can open an issue in the repo | ||
- name: 📝 Report --pre Failures | ||
if: failure() && github.event_name == 'schedule' | ||
uses: JasonEtco/create-an-issue@v2 | ||
|
@@ -74,8 +73,12 @@ jobs: | |
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule' | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
@@ -91,9 +94,8 @@ jobs: | |
- name: 🚢 Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TWINE_API_KEY }} | ||
|
||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: true | ||
files: './dist/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ build-backend = "hatchling.build" | |
[tool.hatch.version] | ||
source = "vcs" | ||
|
||
# https://hatch.pypa.io/latest/config/build/ | ||
[tool.hatch.build.targets.wheel] | ||
only-include = ["src"] | ||
sources = ["src"] | ||
|
||
# [tool.hatch.build.targets.wheel.hooks.mypyc] | ||
# mypy-args = ["--ignore-missing-imports"] | ||
# dependencies = ["hatch-mypyc>=0.13.0"] | ||
|
@@ -22,12 +27,13 @@ license = { text = "BSD-3-Clause" } | |
authors = [{ name = "Talley Lambert", email = "[email protected]" }] | ||
classifiers = [ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python :: 3.12", | ||
"Typing :: Typed", | ||
] | ||
# add your package dependencies here | ||
|
@@ -44,14 +50,7 @@ dependencies = [ | |
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies | ||
[project.optional-dependencies] | ||
test = ["pytest", "pytest-cov"] | ||
dev = [ | ||
"black", | ||
"ipython", | ||
"mypy", | ||
"pdbpp", # https://github.com/pdbpp/pdbpp | ||
"rich", # https://github.com/Textualize/rich | ||
"ruff", | ||
] | ||
dev = ["ipython", "mypy", "pdbpp", "rich", "ruff", "pre-commit"] | ||
|
||
[project.urls] | ||
homepage = "https://github.com/tlambert03/microsim" | ||
|
@@ -60,35 +59,35 @@ repository = "https://github.com/tlambert03/microsim" | |
[tool.ruff] | ||
line-length = 88 | ||
target-version = "py38" | ||
# https://beta.ruff.rs/docs/rules/ | ||
src = ["src"] | ||
|
||
[tool.ruff.lint] | ||
pydocstyle = { convention = "numpy" } | ||
select = [ | ||
"E", # style errors | ||
"W", # style warnings | ||
"F", # flakes | ||
# "D", # pydocstyle | ||
"E", # style errors | ||
"W", # style warnings | ||
"F", # flakes | ||
"D", # pydocstyle | ||
"D417", # Missing argument descriptions in Docstrings | ||
"I", # isort | ||
"S", | ||
"UP", # pyupgrade | ||
"C4", # flake8-comprehensions | ||
"B", # flake8-bugbear | ||
"A001", # flake8-builtins | ||
"RUF", # ruff-specific rules | ||
"TCH", # flake8-type-checking | ||
"TID", # flake8-tidy-imports | ||
] | ||
ignore = [ | ||
"D100", # Missing docstring in public module | ||
"D107", # Missing docstring in __init__ | ||
"D203", # 1 blank line required before class docstring | ||
"D212", # Multi-line docstring summary should start at the first line | ||
"D213", # Multi-line docstring summary should start at the second line | ||
"D10", # Missing docstring in public ... | ||
"D401", # First line should be in imperative mood | ||
"D413", # Missing blank line after last section | ||
"D416", # Section name should end with a colon | ||
] | ||
|
||
[tool.ruff.per-file-ignores] | ||
[tool.ruff.lint.per-file-ignores] | ||
"tests/*.py" = ["D", "S"] | ||
"setup.py" = ["D"] | ||
|
||
|
||
# https://mypy.readthedocs.io/en/stable/config_file.html | ||
[tool.mypy] | ||
files = "src/**/" | ||
|
@@ -97,14 +96,15 @@ disallow_any_generics = false | |
disallow_subclassing_any = false | ||
show_error_codes = true | ||
pretty = true | ||
plugins = "pydantic.mypy" | ||
|
||
# [[tool.mypy.overrides]] | ||
# module = ["numpy.*",] | ||
# ignore_errors = true | ||
|
||
# https://docs.pytest.org/en/6.2.x/customize.html | ||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
minversion = "7.0" | ||
testpaths = ["tests"] | ||
filterwarnings = ["error"] | ||
|
||
|
@@ -117,9 +117,11 @@ exclude_lines = [ | |
"except ImportError", | ||
"\\.\\.\\.", | ||
"raise NotImplementedError()", | ||
"pass" | ||
] | ||
|
||
[tool.coverage.run] | ||
source = ["src"] | ||
source = ["microsim"] | ||
|
||
# https://github.com/mgedmin/check-manifest#configuration | ||
# add files that you want check-manifest to explicitly ignore here | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Light microscopy simulation in python.""" | ||
|
||
from importlib.metadata import PackageNotFoundError, version | ||
|
||
try: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from .models._renderable import Renderable | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from microsim.models._renderable import Renderable | ||
|
||
def convolve(a, b) -> "Renderable": | ||
... | ||
|
||
def convolve(a, b) -> "Renderable": ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from ..models import Illumination | ||
from microsim.models import Illumination | ||
|
||
|
||
class Widefield(Illumination): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.