Skip to content

Commit

Permalink
setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
starhel committed Mar 20, 2018
1 parent 4ff19e8 commit 07545bc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[![codecov](https://codecov.io/gh/starhel/dataslots/branch/master/graph/badge.svg)](https://codecov.io/gh/starhel/dataslots)

## Decorator for adding __slots__
In python3.7 there is dataclasses module ([PEP 557](https://www.python.org/dev/peps/pep-0557/)). Unfortunately there's
no support for \_\_slots__ ([dataclasses #28][dataclasses_issue]). **dataslots** package adds with_slots decorator to
create new class with proper \_\_slots__.
Python3.7 provides dataclasses module for faster class creation ([PEP 557](https://www.python.org/dev/peps/pep-0557/)).
Unfortunately there's no support for \_\_slots__. If you want to create more memory efficient instances, you need to
do it by yourself or use dataslots.with_slots decorator.

## Usage
#### Simple example
Expand Down Expand Up @@ -64,7 +64,7 @@ for attribute or use typing.ClassVar to declare one.
@dataclass
class A:
x = 5
y: ClassVar[Set] = set()
y: ClassVar[set] = set()
```

## More about \_\_slots__
Expand Down
27 changes: 27 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from setuptools import setup
import os


def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()


setup(
name='dataslots',
packages=['dataslots'],
version='1.0.0',
description='Decorator to add __slots__ in dataclasses',
long_description=read('README.md'),
long_description_content_type='text/markdown',
author='Adrian Stachlewski',
author_email='starhel.github@gmail.com',
url='https://github.com/starhel/dataslots',
keywords=['dataslots', 'slots', 'dataclasses'],
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.7",
"Intended Audience :: Developers"
],
python_requires='>=3.7'
)

0 comments on commit 07545bc

Please sign in to comment.