Skip to content

Commit

Permalink
Fixed setup.py and setup.cfg
Browse files Browse the repository at this point in the history
and 1 formatting issue
  • Loading branch information
KOLANICH committed Mar 17, 2020
1 parent b54805c commit 2bb6a8a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions kaitaistruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ def __init__(self, max, actual, io, src_path):
self.max = max
self.actual = actual


class ValidationNotAnyOfError(ValidationFailedError):
"""Signals validation failure: we required "actual" value to be
from the list, but it turned out that it's not.
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = ["setuptools>=42", "wheel", "read_version[toml]>=0.3.0", "pathlib2; python_version < '3'"]
build-backend = "setuptools.build_meta"

[tool.read_version]
version = "kaitaistruct:__version__"
13 changes: 9 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = kaitaistruct
version = attr: kaitaistruct.__version__
version = attr: __version__
author = Kaitai Project
author_email = [email protected]
url = http://kaitai.io
Expand All @@ -20,6 +20,7 @@ classifiers =
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy

Expand All @@ -28,16 +29,20 @@ zip_safe = True
include_package_data = True
py_modules = kaitaistruct
python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
install_requires =
enum34; python_version < "3.4"
setup_requires =
setuptools>=42
wheel
read_version[toml]>=0.3.0
pathlib2; python_version < "3"

[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
universal=1

[build-system]
requires = ["setuptools", "wheel"]

[pycodestyle]
max-line-length = 140
statistics = True
10 changes: 2 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import os
from setuptools import setup
from setuptools.config import read_configuration

this_dir = os.path.dirname(__file__)
cfg = read_configuration(os.path.join(this_dir, 'setup.cfg'))
cfg["options"].update(cfg["metadata"])
cfg = cfg["options"]

setup(**cfg)
if __name__ == "__main__":
setup()

0 comments on commit 2bb6a8a

Please sign in to comment.