<commit_before>from __future__ import absolute_import
from setuptools import setup, Command, find_packages

import os
import os.path
import subprocess


# See anytemplate/globals.py
PACKAGE = "anytemplate"
VERSION = "0.1.4"

# For daily snapshot versioning mode:
if os.environ.get("_SNAPSHOT_BUILD", None) is not None:
    import datetime
    VERSION = VERSION + datetime.datetime.now().strftime(".%Y%m%d")

data_files = []
CLASSIFIERS = ["Development Status :: 4 - Beta",
               "Intended Audience :: Developers",
               "Programming Language :: Python",
               "Programming Language :: Python :: 2",
               "Programming Language :: Python :: 2.6",
               "Programming Language :: Python :: 2.7",
               "Programming Language :: Python :: 3",
               "Programming Language :: Python :: 3.3",
               "Programming Language :: Python :: 3.4",
               "Programming Language :: Python :: 3.5",
               "Programming Language :: Python :: 3.6",
               "Environment :: Console",
               "Operating System :: OS Independent",
               "Topic :: Software Development :: Libraries :: Python Modules",
               "Topic :: Text Processing :: Markup",
               "Topic :: Utilities",
               "License :: OSI Approved :: MIT License",
               ]


class SrpmCommand(Command):

    user_options = []
    build_stage = "s"

    curdir = os.path.abspath(os.curdir)
    rpmspec = os.path.join(curdir, "pkg/package.spec")

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        self.pre_sdist()
        self.run_command('sdist')
        self.build_rpm()

    def pre_sdist(self):
        c = open(self.rpmspec + ".in").read()
        open(self.rpmspec, "w").write(c.replace("@VERSION@", VERSION))

    def build_rpm(self):
        rpmbuild = os.path.join(self.curdir, "pkg/rpmbuild-wrapper.sh")<commit_msg>fix: [rpm] make 'python setup.py srpm' works w/ quick and dirty hack<commit_after>from __future__ import absolute_import
from setuptools import setup, Command, find_packages

import os
import os.path
import subprocess


# See anytemplate/globals.py
PACKAGE = "anytemplate"
VERSION = "0.1.4"

# For daily snapshot versioning mode:
if os.environ.get("_SNAPSHOT_BUILD", None) is not None:
    import datetime
    VERSION = VERSION + datetime.datetime.now().strftime(".%Y%m%d")

data_files = []
CLASSIFIERS = ["Development Status :: 4 - Beta",
               "Intended Audience :: Developers",
               "Programming Language :: Python",
               "Programming Language :: Python :: 2",
               "Programming Language :: Python :: 2.6",
               "Programming Language :: Python :: 2.7",
               "Programming Language :: Python :: 3",
               "Programming Language :: Python :: 3.3",
               "Programming Language :: Python :: 3.4",
               "Programming Language :: Python :: 3.5",
               "Programming Language :: Python :: 3.6",
               "Environment :: Console",
               "Operating System :: OS Independent",
               "Topic :: Software Development :: Libraries :: Python Modules",
               "Topic :: Text Processing :: Markup",
               "Topic :: Utilities",
               "License :: OSI Approved :: MIT License",
               ]


class SrpmCommand(Command):

    user_options = []
    build_stage = "s"

    curdir = os.path.abspath(os.curdir)
    rpmspec = os.path.join(curdir, "pkg/package.spec")

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        self.pre_sdist()
        self.run_command('sdist')
        # Dirty hack.
        self.copy_file("dist/%s-%s.tar.gz" % (PACKAGE, VERSION),
                                              "dist/RELEASE_%s.tar.gz" % VERSION)
        self.build_rpm()

    def pre_sdist(self):
        c = open(self.rpmspec + ".in").read()
        open(self.rpmspec, "w").write(c.replace("@VERSION@", VERSION))

    def build_rpm(self):
        rpmbuild = os.path.join(self.curdir, "pkg/rpmbuild-wrapper.sh")
{'fraction_non_alphanumeric': 0.1299137104506232, 'fraction_numerical': 0.00862895493767977, 'mean_word_length': 2.207532667179093, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2902220', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1186, 'n_words': 295}