Skip to content

Commit

Permalink
Merge c2e7c19 into 7f92505
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Jul 2, 2018
2 parents 7f92505 + c2e7c19 commit fa29488
Show file tree
Hide file tree
Showing 11 changed files with 206 additions and 266 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ env:
install:
- pip install -U coverage coveralls $DJANGO

script: coverage run -a --source=siteblocks siteblocks/runtests.py
script:
- coverage run --source=siteblocks setup.py test

matrix:

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[aliases]
release = clean --all sdist bdist_wheel upload
test = pytest

[wheel]
universal = 1
40 changes: 32 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
import io
import os
from setuptools import setup
from siteblocks import VERSION
import re
import sys

from setuptools import setup, find_packages

PATH_BASE = os.path.dirname(__file__)


def read_file(fpath):
"""Reads a file within package directories."""
with io.open(os.path.join(PATH_BASE, fpath)) as f:
return f.read()


def get_version():
"""Returns version number, without module import (which can lead to ImportError
if some dependencies are unavailable before install."""
contents = read_file(os.path.join('siteblocks', '__init__.py'))
version = re.search('VERSION = \(([^)]+)\)', contents)
version = version.group(1).replace(', ', '.').strip()
return version

f = open(os.path.join(os.path.dirname(__file__), 'README.rst'))
readme = f.read()
f.close()

setup(
name='django-siteblocks',
version='.'.join(map(str, VERSION)),
version=get_version(),
url='http://github.com/idlesign/django-siteblocks',

description='Reusable application for Django introducing URL-dependent static and dynamic data blocks',
long_description=readme,
long_description=read_file('README.rst'),
license='BSD 3-Clause License',

author='Igor `idle sign` Starikov',
author_email='idlesign@yandex.ru',

packages=['siteblocks'],
packages=find_packages(),
include_package_data=True,
zip_safe=False,

setup_requires=[] + (['pytest-runner'] if 'test' in sys.argv else []),

test_suite='tests',
tests_require=[
'pytest',
'pytest-djangoapp',
],

classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
Expand Down
54 changes: 0 additions & 54 deletions siteblocks/runtests.py

This file was deleted.

202 changes: 0 additions & 202 deletions siteblocks/tests.py

This file was deleted.

Empty file added siteblocks/tests/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions siteblocks/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pytest_djangoapp import configure_djangoapp_plugin

pytest_plugins = configure_djangoapp_plugin()
Loading

0 comments on commit fa29488

Please sign in to comment.