Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/faster macos runners #171

Merged
merged 5 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 10 additions & 27 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,24 @@ concurrency:
cancel-in-progress: true

jobs:
flake8:
name: flake8
ruff:
name: ruff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- run: pip install --upgrade flake8
- name: flake8
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: flake8
run: flake8

isort:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: "3.11"
cache: 'pip'
- run: python -m pip install isort
- name: isort
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: isort
run: isort --check --diff json2xml

- run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff
run: |
ruff json2xml
ruff tests


mypy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
os: [
ubuntu-latest,
windows-latest,
macos-latest,
macos-13,
]

steps:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The library supports the following features:
* convert from a `json` file
* convert from an API that emits `json` data

Usage
Usage
^^^^^

The library can be used in these ways:
Expand Down
1 change: 1 addition & 0 deletions json2xml/dicttoxml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

import datetime
import logging
import numbers
Expand Down
2 changes: 1 addition & 1 deletion json2xml/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Utils methods to convert XML data to dict from various sources"""
from __future__ import annotations

"""Utils methods to convert XML data to dict from various sources"""
import json

import urllib3
Expand Down
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.ruff]
exclude = [
".env",
".venv",
"**/migrations/**",
]
ignore = [
"E501", # line too long
"F403", # 'from module import *' used; unable to detect undefined names
"E701", # multiple statements on one line (colon)
"F401", # module imported but unused
]
line-length = 119
select = [
"I",
"E",
"F",
"W",
]
14 changes: 10 additions & 4 deletions tests/test_json2xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

"""Tests for `json2xml` package."""

import pytest
import json

import pytest
import xmltodict
from pyexpat import ExpatError

from json2xml import json2xml
from json2xml.utils import (InvalidDataError, JSONReadError, StringReadError,
URLReadError, readfromjson, readfromstring,
readfromurl)
from json2xml.utils import (
InvalidDataError,
JSONReadError,
StringReadError,
URLReadError,
readfromjson,
readfromstring,
readfromurl,
)


class TestJson2xml:
Expand Down