<commit_before>#!/usr/bin/env python
from plumbum import local, cli, FG
from plumbum.path.utils import delete

try:
    from plumbum.cmd import twine
except ImportError:
    twine = None

class BuildProject(cli.Application):
    'Build and optionally upload. For help, see https://packaging.python.org/en/latest/distributing/#uploading-your-project-to-pypi'
    upload = cli.Flag("upload", help = "If given, the artifacts will be uploaded to PyPI")

    def main(self):
        delete(local.cwd // "*.egg-info", "build", "dist")

        #if self.upload:
        #    local.python("setup.py", "register")

        local.python("setup.py", "sdist", "--formats=gztar", "bdist_wininst", "--plat-name=win32", "bdist_wheel")

        delete(local.cwd // "*.egg-info", "build")

        if self.upload:
            if twine is None:
                print("Twine not installed, cannot securely upload. Install twine.")
            else:
                twine['upload','dist/*gztar' 'dist/*.exe' '*.whl'] & FG


if __name__ == "__main__":
    BuildProject.run()<commit_msg>Universal wheel in build script<commit_after>#!/usr/bin/env python
from plumbum import local, cli, FG
from plumbum.path.utils import delete

try:
    from plumbum.cmd import twine
except ImportError:
    twine = None

class BuildProject(cli.Application):
    'Build and optionally upload. For help, see https://packaging.python.org/en/latest/distributing/#uploading-your-project-to-pypi'
    upload = cli.Flag("upload", help = "If given, the artifacts will be uploaded to PyPI")

    def main(self):
        delete(local.cwd // "*.egg-info", "build", "dist")

        #if self.upload:
        #    local.python("setup.py", "register")

        local.python("setup.py", "sdist", "--formats=gztar", "bdist_wininst", "--plat-name=win32", "bdist_wheel", "--universal")

        delete(local.cwd // "*.egg-info", "build")

        if self.upload:
            if twine is None:
                print("Twine not installed, cannot securely upload. Install twine.")
            else:
                twine['upload','dist/*gztar' 'dist/*.exe' '*.whl'] & FG


if __name__ == "__main__":
    BuildProject.run()
{'fraction_non_alphanumeric': 0.1502542764678687, 'fraction_numerical': 0.0018492834026814608, 'mean_word_length': 2.7964912280701753, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '27850', 'n_tokens_mistral': 720, 'n_tokens_neox': 683, 'n_words': 176}