Skip to content

Commit

Permalink
feat: make deps more flexible (#158)
Browse files Browse the repository at this point in the history
* feat: make deps more flexible

* feat: we don't have requirements.txt anymore

* fix: make testing more reliable

* fix: update the test as the underlying library changed types:

v0.12.0..v0.13.0 has changed the type of what is returned.

```diff
-from collections import OrderedDict
+_dict = dict
+import platform
```

Authored-by: Vinit Kumar <[email protected]>
Signed-off-by: Vinit Kumar <[email protected]>

* fix: remove imports

Signed-off-by: Vinit Kumar <[email protected]>
  • Loading branch information
Vinit Kumar authored Oct 16, 2022
1 parent 8a68519 commit db6e2e5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 34 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -r requirements.txt
pip install xmltodict==0.12.0
pip install pytest==7.0.1
pip install coverage==6.3.2
pip install py==1.11.0
pip install -r requirements-dev.txt
python setup.py install
- name: Unit tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
include requirements.txt
include requirements.in
recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Expand Down
12 changes: 6 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# When installing dev dependencies also install the user dependencies
-r requirements.txt
xmltodict==0.12.0
pytest==7.0.1
coverage==6.3.2
py==1.11.0
flake8==4.0.1
-r requirements.in
xmltodict>=0.12.0
pytest
coverage
py
flake8
18 changes: 0 additions & 18 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
with open("HISTORY.rst") as history_file:
history = history_file.read()

requirements = [open("requirements.txt").read()]
requirements = [open("requirements.in").read()]

setup_requirements = []

Expand Down
3 changes: 1 addition & 2 deletions tests/test_json2xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import pytest
import json
from collections import OrderedDict

import xmltodict
from pyexpat import ExpatError
Expand Down Expand Up @@ -68,7 +67,7 @@ def test_json_to_xml_conversion(self):
)
xmldata = json2xml.Json2xml(data).to_xml()
dict_from_xml = xmltodict.parse(xmldata)
assert type(dict_from_xml["all"]) == OrderedDict
assert type(dict_from_xml["all"]) == dict

def test_custom_wrapper_and_indent(self):
data = readfromstring(
Expand Down

0 comments on commit db6e2e5

Please sign in to comment.