diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index cacd9ed..e733dff 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -11,12 +11,14 @@ on: - main jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, windows-latest] python-version: - 3.7 - 3.8 + - 3.9 steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/.gitignore b/.gitignore index 87e7ce4..426f409 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,6 @@ venv.bak/ .DS_Store .idea/ pip-wheel-metadata/ + +# edgetest +.edgetest \ No newline at end of file diff --git a/README.md b/README.md index af0473a..7de457f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,14 @@ Installation from PyPI: $ python -m pip install edgetest-conda ``` +Installation from conda-forge: + +```console +$ conda install -c conda-forge edgetest-conda +``` + + + **NOTE**: This plugin uses ``conda create ...``, so you need to be in a ``conda`` base environment or you must run diff --git a/docs/source/conf.py b/docs/source/conf.py index 918147d..34fc11c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,7 +25,7 @@ author = 'Akshay Gupta' # The short X.Y version -version = "2021.12.0" +version = "2021.12.1" # The full version, including alpha/beta/rc tags release = '' diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index a6ae473..18976e8 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -10,6 +10,14 @@ Installation from PyPI: $ python -m pip install edgetest-conda + +Installation from conda-forge: + +.. code:: console + + $ conda install -c conda-forge edgetest-conda + + .. important:: This package uses ``conda`` to create virtual environments. This means you have to be either diff --git a/edgetest_conda/__init__.py b/edgetest_conda/__init__.py index c6563fa..baea5cf 100644 --- a/edgetest_conda/__init__.py +++ b/edgetest_conda/__init__.py @@ -1,6 +1,6 @@ """Package initialization.""" -__version__ = "2021.12.0" +__version__ = "2021.12.1" __title__ = "edgetest-conda" __description__ = "Conda edgetest plugin" diff --git a/requirements.txt b/requirements.txt index b70c31c..151cafd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,26 +2,27 @@ # This file is autogenerated by pip-compile with python 3.7 # To update, run: # -# pip-compile setup.cfg +# pip-compile # - -cerberus==1.3.3 +cerberus==1.3.4 # via edgetest -click==7.1.2 +click==8.0.3 # via edgetest -edgetest==2021.11.0 - # via edgetest-conda (setup.cfg) -importlib-metadata==4.8.2 - # via pluggy -packaging==20.9 +edgetest==2021.12.5 + # via edgetest-conda (setup.py) +importlib-metadata==4.9.0 + # via + # click + # pluggy +packaging==21.3 # via edgetest pluggy==1.0.0 # via edgetest pyparsing==3.0.6 # via packaging -rstgen==21.3.0 +tabulate==0.8.9 # via edgetest -typing-extensions==4.0.0 +typing-extensions==4.0.1 # via importlib-metadata zipp==3.6.0 # via importlib-metadata diff --git a/setup.cfg b/setup.cfg index 74adf19..da1c35d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,78 +10,94 @@ maintainer = Akshay Gupta maintainer_email = akshay.gupta2@capitalone.com url = https://github.com/capitalone/edgetest-conda python_requires = - >=3.7.0 + >=3.7.0 project_urls = - Documentation = https://capitalone.github.io/edgetest-conda - Bug Tracker = https://github.com/capitalone/edgetest-conda/issues - Source Code = https://github.com/capitalone/edgetest-conda + Documentation = https://capitalone.github.io/edgetest-conda + Bug Tracker = https://github.com/capitalone/edgetest-conda/issues + Source Code = https://github.com/capitalone/edgetest-conda classifiers = - Intended Audience :: Developers - Natural Language :: English - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 + Intended Audience :: Developers + Natural Language :: English + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 [options] zip_safe = False include_package_data = True packages = find: install_requires = - edgetest + edgetest [options.extras_require] docs = - furo - sphinx - sphinx-copybutton - sphinx-tabs + furo + sphinx + sphinx-copybutton + sphinx-tabs tests = - coverage - flake8 - mypy - pydocstyle - pytest - pytest-cov + coverage + flake8 + mypy + pydocstyle + pytest + pytest-cov qa = - black - isort - pip-tools - pre-commit - pylint + black + isort + pip-tools + pre-commit + pylint build = - build - twine - wheel - bumpver + build + twine + wheel + bumpver dev = - %(tests)s - %(docs)s - %(qa)s - %(build)s + coverage + flake8 + mypy + pydocstyle + pytest + pytest-cov + furo + sphinx + sphinx-copybutton + sphinx-tabs + black + isort + pip-tools + pre-commit + pylint + build + twine + wheel + bumpver [options.entry_points] edgetest = - conda = edgetest_conda.plugin + conda = edgetest_conda.plugin [bumpver] -current_version = "2021.12.0" +current_version = "2021.12.1" version_pattern = "YYYY.MM.INC0" commit_message = "Bump {old_version} to {new_version}" commit = True [bumpver:file_patterns] -docs/source/conf.py = - version = "{version}" -setup.cfg = - current_version = "{version}" -edgetest_conda/__init__.py = - __version__ = "{version}" +docs/source/conf.py = + version = "{version}" +setup.cfg = + current_version = "{version}" +edgetest_conda/__init__.py = + __version__ = "{version}" [aliases] -lint=pylint +lint = pylint [bdist_wheel] python-tag = py3 @@ -93,11 +109,11 @@ max-complexity = 17 ignore = E203, W503 [isort] -multi_line_output=3 -include_trailing_comma=True -force_grid_wrap=0 -use_parentheses=True -line_length=88 +multi_line_output = 3 +include_trailing_comma = True +force_grid_wrap = 0 +use_parentheses = True +line_length = 88 [mypy] python_version = 3.7 @@ -110,7 +126,12 @@ allow_redefinition = True pylint_minimum_score = 9.5 [tool:pytest] -markers = - unit: mark unit tests that do not require external interfaces and use mocking - integration: mark test that interact with an external system +markers = + unit: mark unit tests that do not require external interfaces and use mocking + integration: mark test that interact with an external system addopts = --verbose + +[edgetest] +extras = + tests + diff --git a/tests/test_hook.py b/tests/test_hook.py index b5434e1..c677c57 100644 --- a/tests/test_hook.py +++ b/tests/test_hook.py @@ -1,5 +1,6 @@ """Test the conda hook.""" +import platform from pathlib import Path from unittest.mock import call, patch, PropertyMock @@ -40,12 +41,11 @@ TABLE_OUTPUT = """ -============= =============== =================== ================= - Environment Passing tests Upgraded packages Package version -------------- --------------- ------------------- ----------------- - myenv True myupgrade 0.2.0 -============= =============== =================== ================= - +============= =============== =================== ================= +Environment Passing tests Upgraded packages Package version +============= =============== =================== ================= +myenv True myupgrade 0.2.0 +============= =============== =================== ================= """ @pytest.mark.parametrize("config", [CFG, CFG_NOCONDA]) @@ -105,6 +105,11 @@ def test_conda_create(mock_popen, mock_cpopen): assert result.exit_code == 0 env_loc = str(Path(loc) / ".edgetest" / "myenv") + if platform.system() == "Windows": + py_loc = str(Path(env_loc) / "Scripts" / "python") + else: + py_loc = str(Path(env_loc) / "bin" / "python") + assert mock_popen.call_args_list == [ call( @@ -123,24 +128,24 @@ def test_conda_create(mock_popen, mock_cpopen): universal_newlines=True ), call( - (f"{env_loc}/bin/python", "-m", "pip", "install", "."), + (f"{py_loc}", "-m", "pip", "install", "."), stdout=-1, universal_newlines=True, ), call( - (f"{env_loc}/bin/python", "-m", "pip", "install", "myupgrade", "--upgrade"), + (f"{py_loc}", "-m", "pip", "install", "myupgrade", "--upgrade"), stdout=-1, universal_newlines=True, ), call( - (f"{env_loc}/bin/python", "-m", "pip", "list", "--format", "json"), + (f"{py_loc}", "-m", "pip", "list", "--format", "json"), stdout=-1, universal_newlines=True, ), ] assert mock_cpopen.call_args_list == [ call( - (f"{env_loc}/bin/python", "-m", "pytest", "tests", "-m", "not integration"), + (f"{py_loc}", "-m", "pytest", "tests", "-m", "not integration"), universal_newlines=True, ) ] @@ -167,6 +172,10 @@ def test_mamba_create(mock_popen, mock_cpopen): assert result.exit_code == 0 env_loc = str(Path(loc) / ".edgetest" / "myenv") + if platform.system() == "Windows": + py_loc = str(Path(env_loc) / "Scripts" / "python") + else: + py_loc = str(Path(env_loc) / "bin" / "python") assert mock_popen.call_args_list == [ call( @@ -185,24 +194,24 @@ def test_mamba_create(mock_popen, mock_cpopen): universal_newlines=True ), call( - (f"{env_loc}/bin/python", "-m", "pip", "install", "."), + (f"{py_loc}", "-m", "pip", "install", "."), stdout=-1, universal_newlines=True, ), call( - (f"{env_loc}/bin/python", "-m", "pip", "install", "myupgrade", "--upgrade"), + (f"{py_loc}", "-m", "pip", "install", "myupgrade", "--upgrade"), stdout=-1, universal_newlines=True, ), call( - (f"{env_loc}/bin/python", "-m", "pip", "list", "--format", "json"), + (f"{py_loc}", "-m", "pip", "list", "--format", "json"), stdout=-1, universal_newlines=True, ), ] assert mock_cpopen.call_args_list == [ call( - (f"{env_loc}/bin/python", "-m", "pytest", "tests", "-m", "not integration"), + (f"{py_loc}", "-m", "pytest", "tests", "-m", "not integration"), universal_newlines=True, ) ]