Skip to content

Commit

Permalink
Move version into __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-RR committed Apr 24, 2019
1 parent 64bc472 commit 5c31dfc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion pysnooper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Copyright 2019 Ram Rachum and collaborators.
# This program is distributed under the MIT license.

from .pysnooper import snoop
from .pysnooper import snoop
import collections

__VersionInfo = collections.namedtuple('VersionInfo',
('major', 'minor', 'micro'))

__version_info__ = __VersionInfo(0, 0, 16)
__version__ = '.'.join(map(str, __version_info__))

del collections, __VersionInfo # Avoid polluting the namespace

This comment has been minimized.

Copy link
@bittner

bittner Apr 25, 2019

Collaborator

There's too much in here. You shouldn't import anything, you shouldn't do any logic.

If you do you're calling for trouble.

This comment has been minimized.

Copy link
@cool-RR

cool-RR Apr 25, 2019

Author Owner

So people will have to do something like import pysnooper.pysnooper to use the decorator?

4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"""
import setuptools

import pysnooper


def read_file(filename):
"""Return the contents of a file"""
Expand All @@ -15,7 +17,7 @@ def read_file(filename):

setuptools.setup(
name='PySnooper',
version='0.0.15',
version=pysnooper.__version__,
author='Ram Rachum',
author_email='ram@rachum.com',
description="A poor man's debugger for Python.",

This comment has been minimized.

Copy link
@bittner

bittner Apr 25, 2019

Collaborator

Not only __version__. Take a look at the examples I posted. You should add more info to your package.

Think: The pysnooper package should have useful meta data. Try dir(pysnooper) and help(pysnooper) and pysnooper.__doc__.

This comment has been minimized.

Copy link
@cool-RR

cool-RR Apr 25, 2019

Author Owner

I think that the rest isn't very important. A docstring for the package would be nice.

Expand Down

0 comments on commit 5c31dfc

Please sign in to comment.