<commit_before>"""Setup for pip package."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from setuptools import find_namespace_packages
from setuptools import setup


def _get_sonnet_version():
  with open('sonnet/__init__.py') as fp:
    for line in fp:
      if line.startswith('__version__'):
        return line.split('=', 2)[1].strip()
    raise ValueError('`__version__` not defined in `sonnet/__init__.py`')

_VERSION = _get_sonnet_version()

EXTRA_PACKAGES = {
    'tensorflow': ['tensorflow>=2'],
    'tensorflow with gpu': ['tensorflow-gpu>=2'],
}

REQUIRED_PACKAGES = [
    'absl-py',
    'numpy',
    'six',
    'wrapt'
]

setup(
    name='dm-sonnet',
    version=_VERSION,
    url='https://github.com/deepmind/sonnet',
    license='Apache 2.0',
    author='DeepMind',
    description=(
        'Sonnet is a library for building neural networks in TensorFlow.'),
    long_description=open('README.md').read(),<commit_msg>Correctly parse Sonnet __version__ by execing it.<commit_after>"""Setup for pip package."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from setuptools import find_namespace_packages
from setuptools import setup


def _get_sonnet_version():
  with open('sonnet/__init__.py') as fp:
    for line in fp:
      if line.startswith('__version__'):
        g = {}
        exec(line, g)  # pylint: disable=exec-used
        return g['__version__']
    raise ValueError('`__version__` not defined in `sonnet/__init__.py`')

_VERSION = _get_sonnet_version()

EXTRA_PACKAGES = {
    'tensorflow': ['tensorflow>=2'],
    'tensorflow with gpu': ['tensorflow-gpu>=2'],
}

REQUIRED_PACKAGES = [
    'absl-py',
    'numpy',
    'six',
    'wrapt'
]

setup(
    name='dm-sonnet',
    version=_VERSION,
    url='https://github.com/deepmind/sonnet',
    license='Apache 2.0',
    author='DeepMind',
    description=(
        'Sonnet is a library for building neural networks in TensorFlow.'),
    long_description=open('README.md').read(),
{'fraction_non_alphanumeric': 0.1308097747963584, 'fraction_numerical': 0.004791566842357451, 'mean_word_length': 3.9361702127659575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2380211', 'n_tokens_mistral': 686, 'n_tokens_neox': 678, 'n_words': 165}