sagepublishing / rejected_article_tracker_pkg

MIT License
14 stars 1 forks source link

FileNotFoundError: rejected_article_tracker/src/ML/small_models/lr_model #9

Closed dhimmel closed 3 years ago

dhimmel commented 3 years ago

I did pip install rejected_article_tracker in a fresh environment. Hit the following error on import:

>>> from rejected_article_tracker import RejectedArticlesMatch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dhimmel/miniconda3/envs/rejected-article-tracker/lib/python3.9/site-packages/rejected_article_tracker/__init__.py", line 22, in <module>
    shutil.copy(lr_model_path, dest_model_path)
  File "/home/dhimmel/miniconda3/envs/rejected-article-tracker/lib/python3.9/shutil.py", line 418, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/dhimmel/miniconda3/envs/rejected-article-tracker/lib/python3.9/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/home/dhimmel/miniconda3/envs/rejected-article-tracker/lib/python3.9/site-packages/rejected_article_tracker/src/ML/small_models/lr_model'

I see the following lines intended to include this file/directory in the distribution:

https://github.com/sagepublishing/rejected_article_tracker_pkg/blob/94ab0918d965437b4919ab60206e7762c40b77e8/setup.py#L17-L18

testing as part of https://github.com/openjournals/joss-reviews/issues/3348

dhimmel commented 3 years ago

Noting that src/ML/small_models/lr_model is a file.

Documentation at https://setuptools.readthedocs.io/en/latest/userguide/datafiles.html.

ad48 commented 3 years ago

Apologies! This issue came up a few weeks ago and I thought I had fixed it. Will sort it out.

ad48 commented 3 years ago

I updated Manifest.in and this seems to have corrected the issue. I've reinstalled and run from scratch. All appears to be working. (Sorry, I forgot to include the issue number in the commit) https://github.com/sagepublishing/rejected_article_tracker_pkg/blob/main/MANIFEST.in

dhimmel commented 3 years ago

I updated Manifest.in and this seems to have corrected the issue

Okay updated in https://github.com/sagepublishing/rejected_article_tracker_pkg/commit/591c0db717541e480bb5f37a07130badf1f34dd9. Let me know when a new version is released on PyPI and I will test things again.

ad48 commented 3 years ago

@dhimmel I think that's the latest version up there now. I've reinstalled from pypi and run the run_sample.py file which is working as expected.