From 6d2c34ff5a153eb617addf6de837b2b6effe5530 Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Thu, 13 Dec 2018 19:39:11 +0300 Subject: [PATCH] Create PyPI package --- .gitignore | 3 +++ MANIFEST.in | 4 ++++ Makefile | 23 +++++++++++++++++++++++ README.md | 6 ++++-- setup.py | 39 +++++++++++++++++++++------------------ 5 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 MANIFEST.in create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index c18dd8d..45c0524 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ __pycache__/ +build/ +dist/ +*.egg-info/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..051d663 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include LICENSE +include README.md +include MANIFEST.in +recursive-include daterangefilter *.py *.html *.po *.mo diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9dbbebe --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +.PHONY: test sdist wheel release pre-release clean + +test: + python runtests.py + +sdist: + python setup.py sdist + +wheel: + python setup.py bdist_wheel --universal + +release: clean sdist wheel + twine upload dist/* + +pre-release: sdist wheel + twine upload --repository-url https://test.pypi.org/legacy/ dist/* + +clean: + find . -name '*.pyc' -exec rm -f {} + + find . -name '*.pyo' -exec rm -f {} + + rm -rf build + rm -rf dist + rm -rf *.egg-info diff --git a/README.md b/README.md index 91574a7..dada6c1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Build Status](https://travis-ci.org/andreynovikov/django-daterangefilter.svg?branch=master)](https://travis-ci.org/andreynovikov/django-daterangefilter) [![GitHub release](https://img.shields.io/github/release/andreynovikov/django-daterangefilter.svg)](https://github.com/andreynovikov/django-daterangefilter/releases/latest) +[![PyPI release](https://img.shields.io/pypi/v/django-daterangefilter.svg)](https://pypi.org/project/django-daterangefilter/) +[![Python version](https://img.shields.io/pypi/pyversions/django-daterangefilter.svg)](https://pypi.org/project/django-daterangefilter/) [![GitHub issues](https://img.shields.io/github/issues/andreynovikov/django-daterangefilter.svg)](https://github.com/andreynovikov/django-daterangefilter/issues) [![GitHub license](https://img.shields.io/github/license/andreynovikov/django-daterangefilter.svg)](LICENSE) @@ -14,10 +16,10 @@ Application adds three Django admin list filters: ```DateRangeFilter```, ```Past ## Installation -Clone repo into Django project root: +Install ```django-daterangefilter``` using pip: ``` -git clone https://github.com/andreynovikov/django-daterangefilter.git daterangefilter +pip install django-daterangefilter ``` Add ```daterangefilter``` to ```INSTALLED_APPS```. Example: diff --git a/setup.py b/setup.py index ad34405..875dcaf 100644 --- a/setup.py +++ b/setup.py @@ -1,29 +1,32 @@ import setuptools -with open("README.md", "r") as fh: +with open('README.md', 'r') as fh: long_description = fh.read() setuptools.setup( - name="django-daterangefilter", - version="0.0.1", + name='django-daterangefilter', + version='0.1.1', license='MIT', - author="Andrey Novikov", - author_email="novikov@gmail.com", - description="Date range filter for Django admin", + author='Andrey Novikov', + author_email='novikov@gmail.com', + description='Date range filter for Django admin', long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/andreynovikov/django-daterangefilter/tree/master", + long_description_content_type='text/markdown', + url='https://github.com/andreynovikov/django-daterangefilter/tree/master', + project_urls={ + 'Source': 'https://github.com/andreynovikov/django-daterangefilter/', + 'Tracker': 'https://github.com/andreynovikov/django-daterangefilter/issues', + }, packages=setuptools.find_packages(), + include_package_data=True, + zip_safe=False, classifiers=[ - "Framework :: Django", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", + 'Development Status :: 4 - Beta', + 'Framework :: Django', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', ], )