Skip to content

Commit

Permalink
Add mypy (#51)
Browse files Browse the repository at this point in the history
* Add mypy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jan-janssen and pre-commit-ci[bot] authored Nov 30, 2024
1 parent 372437f commit e2c70c6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -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 }}
10 changes: 5 additions & 5 deletions conda_subprocess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

__version__ = _version.get_versions()["version"]
__all__ = [
Popen,
call,
check_call,
check_output,
run,
"Popen",
"call",
"check_call",
"check_output",
"run",
]
3 changes: 2 additions & 1 deletion conda_subprocess/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from conda.base.context import (
PREFIX_NAME_DISALLOWED_CHARS,
ROOT_ENV_NAME,
Context,
_first_writable_envs_dir,
context,
)
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit e2c70c6

Please sign in to comment.