Skip to content

Commit

Permalink
Merge pull request #147 from RonnyPfannschmidt/update-deps
Browse files Browse the repository at this point in the history
update packaging
  • Loading branch information
RonnyPfannschmidt authored Feb 22, 2023
2 parents 225635a + 34b89c7 commit 65e0e27
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 49 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [ "3.7", "3.8", "3.9" , "3.10"]
python-version: [ "3.8", "3.9" , "3.10"]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -42,13 +42,10 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel setuptools setuptools_scm[toml]
- name: Install Build
run: pip install build
- name: Build package
run: |
python setup.py sdist bdist_wheel
run: python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ repos:
- id: reorder-python-imports
args: [--py37-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
#- id: check-yaml
- id: debug-statements
- repo: https://github.com/pycqa/flake8
rev: '5.0.4'
rev: '6.0.0'
hooks:
- id: flake8
exclude: tests
additional_dependencies:
- flake8-quotes>=3.2
- flake8-docstrings>=1.5
- flake8-quotes>=3.3.2
- flake8-docstrings>=1.7.0
6 changes: 3 additions & 3 deletions prance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
__copyright__ = "Copyright (c) 2016-2021 Jens Finkhaeuser"
__license__ = "MIT"
__all__ = ("util", "mixins", "cli", "convert")
import sys

from packaging.version import Version

Expand All @@ -20,16 +21,15 @@
# todo: better gussing
__version__ = "0.20.0+unknown"

from . import mixins


# Define our own error class
class ValidationError(Exception):
pass


from . import mixins

# Placeholder for when no URL is specified for the main spec file
import sys

if sys.platform == "win32": # pragma: nocover
# Placeholder must be absolute
Expand Down
4 changes: 1 addition & 3 deletions prance/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import click

import prance
from prance.util import default_validation_backend


def __write_to_file(filename, specs): # noqa: N802
Expand Down Expand Up @@ -115,9 +116,6 @@ def command_invoke(ctx):
return command_invoke


from prance.util import default_validation_backend


@click.group(cls=GroupWithCommandOptions)
@click.option(
"--resolve/--no-resolve",
Expand Down
5 changes: 3 additions & 2 deletions prance/util/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def is_pathname_valid(pathname):
otherwise.
:rtype: bool
"""
import errno, os
import errno
import os

# If this pathname is either not a string or is but is empty, this pathname
# is invalid.
Expand Down Expand Up @@ -195,7 +196,7 @@ def canonical_filename(filename):
:return: The canonical filename.
:rtype: str
"""
import os, os.path
import os.path

path = from_posix(filename)
while True:
Expand Down
5 changes: 2 additions & 3 deletions prance/util/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ def _dereferencing_iterator(self, base_url, partial, path, recursions):
# Split the reference string into parsed URL and object path
ref_url, obj_path = _url.split_url_reference(base_url, refstring)

translate = (
self.__resolve_method == TRANSLATE_EXTERNAL
and self.parsed_url.path != ref_url.path
translate = (self.__resolve_method == TRANSLATE_EXTERNAL) and (
self.parsed_url.path != ref_url.path
)

if self._skip_reference(base_url, ref_url):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools_scm[toml]>6"]
requires = ["setuptools>60", "wheel", "setuptools_scm[toml]>6"]
build-backend = "setuptools.build_meta"


Expand Down
24 changes: 8 additions & 16 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ license = MITNFA
packages = find:
include_package_data = True
install_requires =
chardet>=3.0,<5.0
ruamel.yaml~=0.17.10
requests~=2.25
chardet>=3.0
ruamel.yaml>=0.17.10
requests>=2.25
six~=1.15
semver~=2.13
packaging~=21.3
packaging>=21.3
zip_safe = True
python_requires = >=3.6
python_requires = >=3.8

[options.packages.find]
exclude =
Expand All @@ -59,7 +58,7 @@ icu = PyICU~=2.4
ssv = swagger-spec-validator~=2.4
osv = openapi-spec-validator~=0.5.1
flex = flex~=6.13
cli = click~=7.0
cli = click>=7.0

[bumpversion]
current_version = 0.20.2
Expand All @@ -82,17 +81,10 @@ exclude =
.git,
__pycache__,
docs/source/conf.py,old,build,dist,.eggs,
ENV,lib,setup.py
.toxgit di
ENV,lib,.tox,
prance/_version.py

ignore =
E111,E114,E128,E121,
E251,
E402,
E401,
N807.
W503

max-line-length = 88
show-source = True
doctests = True
3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

13 changes: 8 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
[tox]
envlist = py3{7,8,9,10}-{default,no_icu}
envlist = py3{8,9,10,11}-{default,no_icu},docs
minver=3.4
isolated_build=true

[testenv]
# Different dependencies for different test environments
extras =
default: dev,ssv,osv,icu,cli
default: dev,ssv,osv,icu,cli
no_icu: dev,ssv,osv,cli
no_osv_or_icu: dev,ssv,cli
flex: dev,flex,icu
bare: dev
deps =
chardet
six
pytest
pytest-cov
# We need to set environment variables for py3 to work with click
Expand All @@ -23,4 +21,9 @@ setenv =
# For Python 3.7 (main dev version), also run flake8 and sphinx
commands =
pytest {posargs}
py37: python setup.py build_sphinx
[testenv:docs]
extras=dev
commands =
sphinx-build -b html \
-d docs/build/doctrees \
docs/source docs/build/html

0 comments on commit 65e0e27

Please sign in to comment.