Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip installed tool fails #292

Open
jayvdb opened this issue Nov 8, 2021 · 1 comment
Open

pip installed tool fails #292

jayvdb opened this issue Nov 8, 2021 · 1 comment

Comments

@jayvdb
Copy link

jayvdb commented Nov 8, 2021

The package doesnt include the /data needed by the app.

On OSX I get

spec-cleaner -i *.spec
ERROR: File 'excludes-bracketing.txt' not found in datadirs
Exception ignored in: <function RpmSpecCleaner.__del__ at 0x10ab28d30>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/spec_cleaner/rpmcleaner.py", line 424, in __del__
    if self.fin:
AttributeError: 'RpmSpecCleaner' object has no attribute 'fin'

IMO the fix is to include the data dir into the package, and put at lower priority than distro packages, e.g.

diff --git a/spec_cleaner/fileutils.py b/spec_cleaner/fileutils.py
index 4e17cd8..d7d50a2 100644
--- a/spec_cleaner/fileutils.py
+++ b/spec_cleaner/fileutils.py
@@ -28,6 +28,7 @@ def open_datafile(name: str) -> IO[str]:
         '{0}/share/spec-cleaner/{1}'.format(homedir, name),
         '{0}/share/spec-cleaner/{1}'.format(sysconfig.get_path('data'), name),
         '{0}/share/spec-cleaner/{1}'.format(sys.prefix, name),
+        '{0}/data/{1}'.format(os.path.dirname(os.path.realpath(__file__)), name),
     )

     for path in possible_paths:
@mcepl
Copy link
Contributor

mcepl commented Feb 9, 2023

??? Wouldn’t it be better just to package data/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants