Skip to content

Commit

Permalink
Merge pull request #15 from PascalEgn/update-pyyaml-code
Browse files Browse the repository at this point in the history
yaml: update load functions
  • Loading branch information
PascalEgn authored Sep 17, 2024
2 parents fdd31e0 + 90f2ba8 commit adb49bc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 59 deletions.
15 changes: 0 additions & 15 deletions .github/actions/install-python-dependencies/action.yml

This file was deleted.

56 changes: 15 additions & 41 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,35 @@ on:

jobs:
Test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [2.7, 3.6]
include:
- python: python3
pip: pip3
- python: python2
pip: pip

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Cache Python
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ github.sha }}

- name: Install python dependencies
uses: ./.github/actions/install-python-dependencies
run: |
${{ matrix.pip }} install --user --upgrade pip
${{ matrix.pip }} --no-cache-dir install --user setuptools wheel py coveralls
${{ matrix.pip }} --no-cache-dir install --user -e .[tests]
- name: Show python dependencies
run: pip freeze
run: |
${{ matrix.python }} --version
${{ matrix.pip }} freeze
- name: Run tests
uses: ./.github/actions/run-tests

- name: Coveralls
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel: true
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.test_number }}

Coveralls:
needs: Test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@v20201129
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

Release:
if: ${{ github.event_name == 'push' }}
Expand All @@ -67,17 +48,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python 2.7
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: 2.7

- name: Cache Python Dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-2.7-${{ github.sha }}
python-version: 3.x

- name: Install python dependencies
uses: ./.github/actions/install-python-dependencies
Expand Down
2 changes: 1 addition & 1 deletion jsonschema2rst/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def schema2rst(schema_file, excluded_key):
change_extension(schema_file.name, JSON_EXTENSION)))

rst = RST_DIRECTIVES
TreeNode.dict2tree(yaml.load(schema_file), tree, excluded_key)
TreeNode.dict2tree(yaml.full_load(schema_file), tree, excluded_key)
rst += _traverse_bfs(tree, _node2rst)
return rst

Expand Down
2 changes: 1 addition & 1 deletion jsonschema2rst/tree_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def improve_parent(obj, node):
temp.write(response.read())

with open(filename) as temp:
schema = yaml.load(temp)
schema = yaml.full_load(temp)
tree = TreeNode("Test_Hep_Schema")
TreeNode.dict2tree(schema, tree)
print(tree)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
]

install_requires = [
'pyyaml',
'pyyaml>=6.0,<7.0',
'autosemver==0.5.5',
'isort<5.0.0',
'six',
Expand Down

0 comments on commit adb49bc

Please sign in to comment.