yoeo / guesslangtools

Tool to build a training dataset for Guesslang, the programming language guesser
MIT License
22 stars 7 forks source link

Copy data directory during installation #2

Closed marionebl closed 4 years ago

marionebl commented 4 years ago

Before

pip install . does not copy data which causes failures when executing

After

pip install . copies data

Context

When trying to set up guesslangtools like this

$ git clone https://github.com/yoeo/guesslangtools.git
$ cd guesslangtools
$ virtualenv venv
$ source source venv/bin/activate
$ pip install .

I ran into the following issue:

$ gltool data
Traceback (most recent call last):
  File "-/venv/bin/gltool", line 8, in <module>
    sys.exit(main())
  File "-/venv/lib/python3.8/site-packages/guesslangtools/__main__.py", line 78, in main
    Config.setup(
  File "-/venv/lib/python3.8/site-packages/guesslangtools/common.py", line 82, in setup
    with languages_path.open() as languages_file:
  File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/pathlib.py", line 1218, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/pathlib.py", line 1074, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '-/venv/lib/python3.8/site-packages/guesslangtools/data/languages.json'