Skip to content

Commit

Permalink
Fix requirements, move to setuptools.scm
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinolog committed Feb 4, 2019
1 parent fa79f70 commit 8edd6e0
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 38 deletions.
63 changes: 31 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ install:
_python:
- &python27
name: "Python 2.7"
python: 2.7
python: "2.7"
- &python34
name: "Python 3.4"
python: 3.4
python: "3.4"
- &python35
name: "Python 3.5"
python: 3.5
python: "3.5"
- &python36
name: "Python 3.6"
python: 3.6
python: "3.6"
- &python37
name: "Python 3.7"
python: 3.7
python: "3.7"
dist: xenial
sudo: true
- &pypy
name: "PyPy"
python: pypy
python: "pypy"
- &pypy3
name: "PyPy3"
python: pypy3.5
python: "pypy3.5"

_helpers:
- &build_package python setup.py bdist_wheel
Expand All @@ -53,23 +53,7 @@ after_success:
- coveralls

jobs:
fast_finish: true
include:
- stage: test
<<: *python27
- stage: test
<<: *python34
- stage: test
<<: *python35
- stage: test
<<: *python36
- stage: test
<<: *python37
- stage: test
<<: *pypy
- stage: test
<<: *pypy3

- <<: *static_analysis
<<: *python36
name: "PyLint"
Expand All @@ -86,21 +70,36 @@ jobs:
- pip install --upgrade bandit
script:
- bandit -r sqlalchemy_jsonfield

- <<: *code_style_check
- <<: *static_analysis
name: "PEP8"
install:
- *upgrade_python_toolset
- pip install --upgrade flake8
script:
- flake8
- <<: *code_style_check
name: "PEP257"
install:
- *upgrade_python_toolset
- pip install --upgrade pydocstyle
script:
- pydocstyle sqlalchemy_jsonfield

- stage: test
<<: *python27
- stage: test
<<: *python34
- stage: test
<<: *python35
- stage: test
<<: *python36
- stage: test
<<: *python37
- stage: test
<<: *pypy
- stage: test
<<: *pypy3

# - <<: *code_style_check
# name: "PEP257"
# install:
# - *upgrade_python_toolset
# - pip install --upgrade pydocstyle
# script:
# - pydocstyle sqlalchemy_jsonfield

- stage: deploy
# This prevents job from appearing in test plan unless commit is tagged:
Expand Down
13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def get_simple_vars_from_src(src):

setuptools.setup(
name="SQLAlchemy-JSONField",
version=variables["__version__"],
author=variables["__author__"],
author_email=variables["__author_email__"],
url=variables["__url__"],
Expand All @@ -146,8 +145,12 @@ def get_simple_vars_from_src(src):
# situations as progressive releases of projects are done.
# Blacklist setuptools 34.0.0-34.3.2 due to https://github.com/pypa/setuptools/issues/951
# Blacklist setuptools 36.2.0 due to https://github.com/pypa/setuptools/issues/1086
setup_requires="setuptools >= 21.0.0,!=24.0.0,"
"!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,"
"!=36.2.0",
install_requires=["sqlalchemy"],
setup_requires=[
"setuptools >= 21.0.0,!=24.0.0,"
"!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,"
"!=36.2.0",
"setuptools_scm",
],
use_scm_version=True,
install_requires=["sqlalchemy", ],
)
18 changes: 17 additions & 1 deletion sqlalchemy_jsonfield/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,25 @@

"""Implement JSONField for SQLAlchemy."""

import pkg_resources

from .jsonfield import JSONField, mutable_json_field

__version__ = "0.7.1"
try: # pragma: no cover
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound: # pragma: no cover
# package is not installed, try to get from SCM
try:
# noinspection PyPackageRequirements,PyUnresolvedReferences
import setuptools_scm # type: ignore

__version__ = setuptools_scm.get_version()
except ImportError:
pass


__all__ = ("JSONField", "mutable_json_field")

__author__ = "Alexey Stepanov <penguinolog@gmail.com>"
__author_email__ = "penguinolog@gmail.com"
__url__ = "https://github.com/penguinolog/sqlalchemy_jsonfield"
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ recreate=True

[testenv]
usedevelop = True
recreate=True
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
deps =
sphinx
Expand Down

0 comments on commit 8edd6e0

Please sign in to comment.