Skip to content

Commit

Permalink
added packaging stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
miki725 committed Aug 31, 2015
1 parent 419ba18 commit 180849f
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .importanizerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"exclude": [
"*/.tox/*"
],
"groups": [
{
"type": "stdlib"
Expand Down
24 changes: 24 additions & 0 deletions .travis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: python

python:
- "3.4"
- "2.7"
- "pypy"
- "pypy3"

env:
- "$DJANGO='django<1.9'"

sudo: false

# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install:
- pip install $DJANGO
- pip install -r requirements-dev.txt
- pip install coveralls
- pip freeze

# command to run tests, e.g. python setup.py test
script: make check

after_success: coveralls
12 changes: 12 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Credits
-------

Development Lead
----------------

* Miroslav Shubernetskiy - https://github.com/miki725

Contributors
------------

None yet. Why not be the first?
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
History
-------

0.1.0 (2015-08-30)
~~~~~~~~~~~~~~~~~~

* First release on PyPI.
26 changes: 26 additions & 0 deletions LICENSE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
License
-------

::

The MIT License (MIT)

Copyright (c) 2015, Miroslav Shubernetskiy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include *.rst *.txt
recursive-include tests *
recursive-include docs *.rst conf.py Makefile make.bat
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
60 changes: 60 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.PHONY: clean-pyc clean-build docs clean

help:
@echo "install - install all requirements including for testing"
@echo "install-quite - same as install but pipes all output to /dev/null"
@echo "clean - remove all artifacts"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test - remove test and coverage artifacts"
@echo "clean-test-all - remove all test-related artifacts including tox"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-coverage - run tests with coverage report"
@echo "test-all - run tests on every Python version with tox"
@echo "check - run all necessary steps to check validity of project"
@echo "release - package and upload a release"
@echo "dist - package"

install:
pip install -U -r requirements-dev.txt

install-quite:
pip install -r requirements-dev.txt > /dev/null

clean: clean-build clean-pyc

clean-build:
@rm -rf build/
@rm -rf dist/
@rm -rf *.egg-info

clean-pyc:
-@find . -name '*.pyc' -follow -print0 | xargs -0 rm -f
-@find . -name '*.pyo' -follow -print0 | xargs -0 rm -f
-@find . -name '__pycache__' -type d -follow -print0 | xargs -0 rm -rf

clean-test:
rm -rf .coverage coverage*
rm -rf htmlcov/

clean-test-all: clean-test
rm -rf .tox/

lint:
flake8 .

test:
py.test -sv --cov=url_filter --cov-report=term-missing tests/

test-all:
tox

check: lint clean-build clean-pyc clean-test test

release: clean
python setup.py sdist upload

dist: clean
python setup.py sdist
ls -l dist
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
-r requirements.txt
Sphinx
Werkzeug
coverage
django-extensions
djangorestframework
flake8
importanize
ipython
mock
pytest
pytest-cov
pytest-django
Sphinx
sphinx-autobuild
sphinx-rtd-theme
tox
watchdog
Werkzeug
55 changes: 55 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os

from setuptools import setup

from url_filter import __author__, __version__


def read(fname):
return (open(os.path.join(os.path.dirname(__file__), fname), 'rb')
.read().decode('utf-8'))


authors = read('AUTHORS.rst')
history = read('HISTORY.rst').replace('.. :changelog:', '')
licence = read('LICENSE.rst')
readme = read('README.rst')

requirements = read('requirements.txt').splitlines() + [
'setuptools',
]

test_requirements = (
read('requirements.txt').splitlines()
+ read('requirements-dev.txt').splitlines()[1:]
)

setup(
name='django-url-filter',
version=__version__,
author=__author__,
description='Django URL Filter provides a safe way to filter data via human-friendly URLs.',
long_description='\n\n'.join([readme, history, authors, licence]),
url='https://github.com/miki725/django-url-filter',
license='MIT',
packages=['url_filter'],
install_requires=requirements,
test_suite='tests',
tests_require=test_requirements,
keywords=' '.join([
'django django-rest-framework',
]),
classifiers=[
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Development Status :: 2 - Pre-Alpha',
],
)
25 changes: 25 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[tox]
envlist =
{py27,py34,pypy,pypy3}-django{18}

[testenv]
basepython =
py27: python2.7
py34: python3.4
pypy: pypy
pypy3: pypy3
setenv =
PYTHONPATH = {toxinidir}
commands =
make install-quite
pip freeze
make check
deps =
django16: django<1.7
django17: django<1.8
django18: django<1.9
whitelist_externals =
make

[flake8]
ignore = E501

0 comments on commit 180849f

Please sign in to comment.