Skip to content

Commit

Permalink
Merge pull request #22 from marshmallow-code/feature/publishing
Browse files Browse the repository at this point in the history
add commands to publish
  • Loading branch information
cancan101 authored Oct 16, 2018
2 parents d677740 + 91e7ab0 commit e57449c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[bdist_wheel]
universal = 1

[flake8]
exclude = venv,.tox,build
max-line-length = 100
35 changes: 32 additions & 3 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
#!/usr/bin/env python

from setuptools import setup
import subprocess

from setuptools import setup, Command


# -----------------------------------------------------------------------------

def read(fname):
with open(fname) as infile:
return infile.read()


def system(command):
class SystemCommand(Command):
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
subprocess.check_call(command, shell=True)

return SystemCommand


# -----------------------------------------------------------------------------

setup(
name='marshmallow-oneofschema',
version='2.0.0b1',
Expand All @@ -17,9 +40,9 @@ def read(fname):
url='https://github.com/maximkulkin/marshmallow-oneofschema',
packages=['marshmallow_oneofschema'],
license=read('LICENSE'),
keywords=('serialization', 'deserialization', 'json',
keywords=['serialization', 'deserialization', 'json',
'marshal', 'marshalling', 'schema', 'validation',
'multiplexing', 'demultiplexing', 'polymorphic'),
'multiplexing', 'demultiplexing', 'polymorphic'],
install_requires=['marshmallow>=3.0.0b12,<=3.0.0b18'],
classifiers=[
'Intended Audience :: Developers',
Expand All @@ -34,4 +57,10 @@ def read(fname):
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
cmdclass={
'clean': system('rm -rf build dist *.egg-info'),
'package': system('python setup.py sdist bdist_wheel'),
'publish': system('twine upload dist/*'),
'release': system('python setup.py clean package publish'),
},
)

0 comments on commit e57449c

Please sign in to comment.