<commit_before>#!/usr/bin/env python

import os
import sys
import setuptools.command.egg_info as egg_info_cmd
import shutil

from setuptools import setup, find_packages

SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')

try:
    import gittaggers
    tagger = gittaggers.EggInfoFromGit
except ImportError:
    tagger = egg_info_cmd.egg_info

# Remove the symlink and copy the schemas directory.
# This is a total hack, but older versions of setuptools
# won't follow symlinks or follow relative paths outside the
# source directory (ugh!)
os.unlink("cwltool/schemas")
shutil.copytree("../schemas", "cwltool/schemas")

setup(name='cwltool',
      version='1.0',
      description='Common workflow language reference implementation',
      long_description=open(README).read(),
      author='Common workflow language working group',
      author_email='<EMAIL>',
      url="https://github.com/common-workflow-language/common-workflow-language",
      download_url="https://github.com/common-workflow-language/common-workflow-language",
      license='Apache 2.0',
      packages=["cwltool"],
      package_data={'cwltool': ['schemas/draft-1/*', 'schemas/draft-2/*']},
      install_requires=[
          'jsonschema >= 2.4.0',
          'requests',
          'PyYAML',
          'avro',
          'rdflib',
          'rdflib-jsonld'
        ],
      test_suite='tests',
      tests_require=[],
      entry_points={
          'console_scripts': [ "cwltool=cwltool.main:main" ]
      },
      zip_safe=False,
      cmdclass={'egg_info': tagger},
)

# Restore the symlink
shutil.rmtree("cwltool/schemas")
os.symlink("../../schemas", "cwltool/schemas")<commit_msg>Check for source tree or install.<commit_after>#!/usr/bin/env python

import os
import sys
import setuptools.command.egg_info as egg_info_cmd
import shutil

from setuptools import setup, find_packages

SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')

try:
    import gittaggers
    tagger = gittaggers.EggInfoFromGit
except ImportError:
    tagger = egg_info_cmd.egg_info

# Remove the symlink and copy the schemas directory.
# This is a total hack, but older versions of setuptools
# won't follow symlinks or follow relative paths outside the
# source directory (ugh!)
restore = False
if os.path.islink("cwltool/schemas") and os.path.exists("../schemas"):
    os.unlink("cwltool/schemas")
    shutil.copytree("../schemas", "cwltool/schemas")
    restore = True

setup(name='cwltool',
      version='1.0',
      description='Common workflow language reference implementation',
      long_description=open(README).read(),
      author='Common workflow language working group',
      author_email='<EMAIL>',
      url="https://github.com/common-workflow-language/common-workflow-language",
      download_url="https://github.com/common-workflow-language/common-workflow-language",
      license='Apache 2.0',
      packages=["cwltool"],
      package_data={'cwltool': ['schemas/draft-1/*', 'schemas/draft-2/*']},
      install_requires=[
          'jsonschema >= 2.4.0',
          'requests',
          'PyYAML',
          'avro',
          'rdflib',
          'rdflib-jsonld'
        ],
      test_suite='tests',
      tests_require=[],
      entry_points={
          'console_scripts': [ "cwltool=cwltool.main:main" ]
      },
      zip_safe=False,
      cmdclass={'egg_info': tagger},
)

if restore:
    # Restore the symlink
    shutil.rmtree("cwltool/schemas")
    os.symlink("../../schemas", "cwltool/schemas")
{'fraction_non_alphanumeric': 0.13628668171557562, 'fraction_numerical': 0.005079006772009029, 'mean_word_length': 3.3496932515337425, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3665011', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1135, 'n_words': 230}