mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 09:36:48 +03:00
commit
c428c23c42
|
@ -1,3 +1,6 @@
|
||||||
[run]
|
[run]
|
||||||
include = dependency_injector/*
|
include = dependency_injector/*
|
||||||
omit = tests/*
|
omit = tests/*
|
||||||
|
|
||||||
|
[html]
|
||||||
|
directory=reports/unittests/
|
||||||
|
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -33,7 +33,7 @@ pip-log.txt
|
||||||
pip-delete-this-directory.txt
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
# Unit test / coverage reports
|
# Unit test / coverage reports
|
||||||
htmlcov/
|
reports/
|
||||||
.tox/
|
.tox/
|
||||||
.coverage
|
.coverage
|
||||||
.cache
|
.cache
|
||||||
|
@ -62,8 +62,5 @@ venv/
|
||||||
# SQLite
|
# SQLite
|
||||||
*.db
|
*.db
|
||||||
|
|
||||||
# JointJS Experiments
|
|
||||||
jointjs/
|
|
||||||
|
|
||||||
# Vim Rope
|
# Vim Rope
|
||||||
.ropeproject/
|
.ropeproject/
|
||||||
|
|
35
Makefile
Normal file
35
Makefile
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
VERSION:=$(shell python setup.py --version)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
# Clean sources
|
||||||
|
find dependency_injector -name '*.py[co]' -delete
|
||||||
|
find dependency_injector -name '__pycache__' -delete
|
||||||
|
find dependency_injector -name '*.c' -delete
|
||||||
|
find dependency_injector -name '*.so' -delete
|
||||||
|
# Clean tests
|
||||||
|
find tests -name '*.py[co]' -delete
|
||||||
|
find tests -name '__pycache__' -delete
|
||||||
|
# Clean examples
|
||||||
|
find examples -name '*.py[co]' -delete
|
||||||
|
find examples -name '__pycache__' -delete
|
||||||
|
|
||||||
|
tests: clean
|
||||||
|
# Unit tests with coverage report
|
||||||
|
coverage erase
|
||||||
|
coverage run --rcfile=./.coveragerc -m unittest2 discover tests
|
||||||
|
coverage report --rcfile=./.coveragerc
|
||||||
|
coverage html --rcfile=./.coveragerc
|
||||||
|
coverage erase
|
||||||
|
# Static analysis
|
||||||
|
flake8 --max-complexity=10 dependency_injector/
|
||||||
|
flake8 --max-complexity=10 examples/
|
||||||
|
# Code style analysis
|
||||||
|
pydocstyle dependency_injector/
|
||||||
|
pydocstyle examples/
|
||||||
|
|
||||||
|
publish: clean
|
||||||
|
# Create and upload build
|
||||||
|
python setup.py sdist upload
|
||||||
|
# Create and upload tag
|
||||||
|
git tag -a $(VERSION) -m 'version $(VERSION)'
|
||||||
|
git push --tags
|
|
@ -10,6 +10,7 @@ follows `Semantic versioning`_
|
||||||
Development version
|
Development version
|
||||||
-------------------
|
-------------------
|
||||||
- Remove ``@inject`` decorator.
|
- Remove ``@inject`` decorator.
|
||||||
|
- Add makefile (``clean``, ``tests`` & ``publish`` commands).
|
||||||
|
|
||||||
.. - No features.
|
.. - No features.
|
||||||
|
|
||||||
|
|
|
@ -4,3 +4,6 @@ sphinx
|
||||||
sphinx_rtd_theme
|
sphinx_rtd_theme
|
||||||
sphinx_autobuild
|
sphinx_autobuild
|
||||||
autodoc
|
autodoc
|
||||||
|
coverage
|
||||||
|
flake8
|
||||||
|
pydocstyle
|
||||||
|
|
25
setup.py
25
setup.py
|
@ -1,10 +1,8 @@
|
||||||
"""`Dependency injector` setup script."""
|
"""`Dependency injector` setup script."""
|
||||||
|
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
from setuptools import Command
|
|
||||||
|
|
||||||
|
|
||||||
# Getting description:
|
# Getting description:
|
||||||
|
@ -20,26 +18,6 @@ with open('dependency_injector/__init__.py') as init_file:
|
||||||
version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
|
version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
|
||||||
|
|
||||||
|
|
||||||
class PublishCommand(Command):
|
|
||||||
"""Setuptools `publish` command."""
|
|
||||||
|
|
||||||
description = "Publish current distribution to PyPi and create tag"
|
|
||||||
user_options = []
|
|
||||||
|
|
||||||
def initialize_options(self):
|
|
||||||
"""Init options."""
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
"""Finalize options."""
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
"""Command execution."""
|
|
||||||
self.run_command('sdist')
|
|
||||||
self.run_command('upload')
|
|
||||||
os.system('git tag -a {0} -m \'version {0}\''.format(version))
|
|
||||||
os.system('git push --tags')
|
|
||||||
|
|
||||||
|
|
||||||
setup(name='dependency-injector',
|
setup(name='dependency-injector',
|
||||||
version=version,
|
version=version,
|
||||||
description='Dependency injection microframework for Python',
|
description='Dependency injection microframework for Python',
|
||||||
|
@ -58,9 +36,6 @@ setup(name='dependency-injector',
|
||||||
platforms=['any'],
|
platforms=['any'],
|
||||||
zip_safe=True,
|
zip_safe=True,
|
||||||
install_requires=requirements,
|
install_requires=requirements,
|
||||||
cmdclass={
|
|
||||||
'publish': PublishCommand,
|
|
||||||
},
|
|
||||||
keywords=[
|
keywords=[
|
||||||
'DI',
|
'DI',
|
||||||
'Dependency injection',
|
'Dependency injection',
|
||||||
|
|
18
tox.ini
18
tox.ini
|
@ -8,24 +8,6 @@ deps=
|
||||||
commands=
|
commands=
|
||||||
unit2 discover tests []
|
unit2 discover tests []
|
||||||
|
|
||||||
[testenv:dev]
|
|
||||||
basepython=python2.7
|
|
||||||
deps=
|
|
||||||
{[testenv]deps}
|
|
||||||
coverage
|
|
||||||
flake8
|
|
||||||
pydocstyle
|
|
||||||
commands=
|
|
||||||
coverage erase
|
|
||||||
coverage run --rcfile=./.coveragerc -m unittest2 discover tests []
|
|
||||||
coverage html --rcfile=./.coveragerc
|
|
||||||
|
|
||||||
flake8 --max-complexity=10 dependency_injector/
|
|
||||||
flake8 --max-complexity=10 examples/
|
|
||||||
|
|
||||||
pydocstyle dependency_injector/
|
|
||||||
pydocstyle examples/
|
|
||||||
|
|
||||||
[testenv:coveralls]
|
[testenv:coveralls]
|
||||||
basepython=python2.7
|
basepython=python2.7
|
||||||
passenv=TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
|
passenv=TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
|
||||||
|
|
Loading…
Reference in New Issue
Block a user