From 45305ceef52098a2f15cbdbb16111b8f950d124a Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sat, 30 Nov 2024 09:54:55 +0100 Subject: [PATCH 1/2] Add mypy --- .github/workflows/mypy.yml | 22 ++++++++++++++++++++++ conda_subprocess/__init__.py | 10 +++++----- conda_subprocess/process.py | 3 ++- 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/mypy.yml diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml new file mode 100644 index 0000000..5e74214 --- /dev/null +++ b/.github/workflows/mypy.yml @@ -0,0 +1,22 @@ +name: MyPy + +on: + push: + branches: [ main ] + pull_request: + +jobs: + mypy: + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + architecture: x64 + - name: Checkout + uses: actions/checkout@v4 + - name: Install mypy + run: pip install mypy + - name: Test + run: mypy --ignore-missing-imports ${{ github.event.repository.name }} \ No newline at end of file diff --git a/conda_subprocess/__init__.py b/conda_subprocess/__init__.py index 1225c92..fa3b185 100644 --- a/conda_subprocess/__init__.py +++ b/conda_subprocess/__init__.py @@ -5,9 +5,9 @@ __version__ = _version.get_versions()["version"] __all__ = [ - Popen, - call, - check_call, - check_output, - run, + "Popen", + "call", + "check_call", + "check_output", + "run", ] diff --git a/conda_subprocess/process.py b/conda_subprocess/process.py index 34f860c..7e71e11 100644 --- a/conda_subprocess/process.py +++ b/conda_subprocess/process.py @@ -8,6 +8,7 @@ ROOT_ENV_NAME, _first_writable_envs_dir, context, + Context, ) from conda.cli.common import validate_prefix from conda.common.compat import encode_arguments, encode_environment, isiterable @@ -127,7 +128,7 @@ def _locate_prefix_by_name(name, envs_dirs=None): raise EnvironmentNameNotFound(name) -def _validate_prefix_name(prefix_name: str, ctx: context, allow_base=True) -> str: +def _validate_prefix_name(prefix_name: str, ctx: Context, allow_base=True) -> str: """Run various validations to make sure prefix_name is valid""" if PREFIX_NAME_DISALLOWED_CHARS.intersection(prefix_name): raise CondaValueError( From 78d6563573654a9f594fc15f47b84a90d040dc0c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 30 Nov 2024 08:55:15 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- conda_subprocess/process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_subprocess/process.py b/conda_subprocess/process.py index 7e71e11..eb174c2 100644 --- a/conda_subprocess/process.py +++ b/conda_subprocess/process.py @@ -6,9 +6,9 @@ from conda.base.context import ( PREFIX_NAME_DISALLOWED_CHARS, ROOT_ENV_NAME, + Context, _first_writable_envs_dir, context, - Context, ) from conda.cli.common import validate_prefix from conda.common.compat import encode_arguments, encode_environment, isiterable