Skip to content

Commit

Permalink
Update license and setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nezhar committed Jan 30, 2020
1 parent 9734211 commit de841e8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
dist/**
django_request_cache.egg-info/**
.idea/**
.vscode/**
venv/
build/
.tox/

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Christian Kreuzberger
Copyright (c) 2017-2020 Christian Kreuzberger, Anexia Internetdienstleistungs GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
59 changes: 50 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,65 @@
import io
import os
import sys
from shutil import rmtree

from setuptools import find_packages, setup
from setuptools import find_packages, setup, Command

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
VERSION = '1.2'

here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
README = '\n' + f.read()


class UploadCommand(Command):
"""Support setup.py upload."""

description = 'Build and publish the package.'
user_options = []

@staticmethod
def status(s):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(s))

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
try:
self.status('Removing previous builds...')
rmtree(os.path.join(here, 'dist'))
except OSError:
pass

self.status('Building Source and Wheel (universal) distribution...')
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))

self.status('Uploading the package to PyPI via Twine...')
os.system('twine upload dist/*')

self.status('Pushing git tags...')
os.system('git tag {0}'.format(VERSION))
os.system('git push --tags')

sys.exit()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

setup(
name='django-request-cache',
version='1.2',
version=VERSION,
packages=find_packages(),
include_package_data=True,
license='MIT',
description='A simple Django app that provides a per-request cache.',
long_description=README,
url='https://github.com/anx-ckreuzberger/django-request-cache',
author='Christian Kreuzberger',
author_email='ckreuzberger@anexia-it.com',
url='https://github.com/anexia-it/django-request-cache',
author='Harald Nezbeda',
author_email='hnezbeda@anexia-it.com',
install_requires=[
"django>=2.1",
"django_userforeignkey"
Expand Down

0 comments on commit de841e8

Please sign in to comment.