From 7a4b6dd3f1cfd953faf97574db33a1f609827504 Mon Sep 17 00:00:00 2001 From: Vinit Kumar Date: Sat, 23 Apr 2022 21:37:57 +0530 Subject: [PATCH 1/2] refactor: xmltodict is only test dependency --- .github/workflows/pythonpackage.yml | 8 ++++---- requirements.in | 1 - requirements.txt | 2 -- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index a487a118..d17ee579 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -30,16 +30,16 @@ jobs: python -m pip install --upgrade pip pip install pytest pip install -r requirements.txt - python setup.py install - - name: Lint with flake8 - run: | pip install flake8 pip install xmltodict==0.12.0 pip install pytest==7.0.1 pip install coverage==6.3.2 pip install py==1.11.0 + python setup.py install + - name: Lint with flake8 + run: | # stop the build if there are Python syntax errors or undefined names - flake8 json2xml/ --exit-zero + flake8 json2xml/ - name: Unit tests run: | coverage run -m pytest diff --git a/requirements.in b/requirements.in index cc9937be..27964c51 100644 --- a/requirements.in +++ b/requirements.in @@ -1,4 +1,3 @@ requests>=2.20.0 defusedxml==0.7.1 -xmltodict diff --git a/requirements.txt b/requirements.txt index 3f5a2a6b..8fc19336 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,5 +16,3 @@ requests==2.26.0 # via -r requirements.in urllib3==1.26.7 # via requests -xmltodict==0.12.0 - # via -r requirements.in From 6ab35e100d17695a5b9a7642d0d33be13487a33c Mon Sep 17 00:00:00 2001 From: Vinit Kumar Date: Sat, 23 Apr 2022 21:46:09 +0530 Subject: [PATCH 2/2] fix: add better testing docs --- .github/workflows/pythonpackage.yml | 5 ----- README.rst | 7 ++++--- requirements-dev.txt | 5 +++++ 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 requirements-dev.txt diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index d17ee579..aea16dd6 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -30,16 +30,11 @@ jobs: python -m pip install --upgrade pip pip install pytest pip install -r requirements.txt - pip install flake8 pip install xmltodict==0.12.0 pip install pytest==7.0.1 pip install coverage==6.3.2 pip install py==1.11.0 python setup.py install - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 json2xml/ - name: Unit tests run: | coverage run -m pytest diff --git a/README.rst b/README.rst index 41b62178..a0fc5971 100644 --- a/README.rst +++ b/README.rst @@ -197,9 +197,10 @@ This is provided by pytest, which is straight forward. .. code-block:: bash - python3.8 -mvenv venv - source venv/bin/activate - python setup.py test + virtualenv venv -p $(which python3.9) + pip install -r requirements-dev.txt + python setup.py install + pytest Credits diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..3f7b99d3 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,5 @@ +-r requirements.txt +xmltodict==0.12.0 +pytest==7.0.1 +coverage==6.3.2 +py==1.11.0