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

shut versions 0.10.x may not have required data folder in package #10

Closed
ndejong opened this issue Nov 30, 2020 · 2 comments
Closed

shut versions 0.10.x may not have required data folder in package #10

ndejong opened this issue Nov 30, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ndejong
Copy link

ndejong commented Nov 30, 2020

shut versions 0.10.x may not have required data folder in package

version 0.9.0

user@computer:~/project$ 
user@computer:~/project$ shut --version
shut, version 0.9.0
user@computer:~/project$ shut pkg checks

  ✔️   classifiers
  ✔️   license
  ✔️   namespace files
  ✔️   package-author
  ✔️   package-url
  ✔️   package-version
  ✔️   readme
  ✔️   up to date

ran 8 checks for package project in 0.011s
user@computer:~/project$ 

version 0.10.3

user@computer:~/project$ shut --version
shut, version 0.10.3
user@computer:~/project$ shut pkg checks
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
Traceback (most recent call last):
  File "/home/user/.local/bin/shut", line 8, in <module>
    sys.exit(shut())
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/shut/commands/pkg/checks.py", line 80, in checks
    sys.exit(check_package(package, warnings_as_errors))
  File "/home/user/.local/lib/python3.8/site-packages/shut/commands/pkg/checks.py", line 61, in check_package
    checks = get_package_checks(package)
  File "/home/user/.local/lib/python3.8/site-packages/shut/commands/pkg/checks.py", line 44, in get_package_checks
    checks = list(get_checks(package))
  File "/home/user/.local/lib/python3.8/site-packages/shut/checkers/base.py", line 125, in get_checks
    yield from checker().get_checks(obj)
  File "/home/user/.local/lib/python3.8/site-packages/shut/checkers/base.py", line 101, in get_checks
    for index, result in enumerate(value(subject)):
  File "/home/user/.local/lib/python3.8/site-packages/shut/checkers/package.py", line 137, in _check_up_to_date
    files = get_files(package)
  File "/home/user/.local/lib/python3.8/site-packages/shut/renderers/core.py", line 78, in get_files
    renderer().get_files(files, obj)
  File "/home/user/.local/lib/python3.8/site-packages/shut/renderers/license.py", line 81, in get_files
    get_license_template(model.license)
  File "/home/user/.local/lib/python3.8/site-packages/shut/renderers/license.py", line 34, in get_license_template
    return resource_string('shut', f'data/license_templates/{license_name}.txt').decode('utf-8')
  File "/home/user/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1155, in resource_string
    return get_provider(package_or_requirement).get_resource_string(
  File "/home/user/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1401, in get_resource_string
    return self._get(self._fn(self.module_path, resource_name))
  File "/home/user/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1626, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.local/lib/python3.8/site-packages/shut/data/license_templates/MIT.txt'
user@computer:~/project$ 
user@computer:~/project$ ls -al /home/user/.local/lib/python3.8/site-packages/shut
total 68
drwxrwxr-x  16 user user 4096 Nov 30 13:29 .
drwx------ 137 user user 4096 Nov 30 13:29 ..
drwxrwxr-x   3 user user 4096 Nov 30 13:29 builders
drwxrwxr-x   3 user user 4096 Nov 30 13:29 changelog
drwxrwxr-x   3 user user 4096 Nov 30 13:29 checkers
drwxrwxr-x   7 user user 4096 Nov 30 13:29 commands
-rw-rw-r--   1 user user 1205 Nov 30 13:29 __init__.py
drwxrwxr-x   3 user user 4096 Nov 30 13:29 lifecycle
drwxrwxr-x   3 user user 4096 Nov 30 13:29 lint
drwxrwxr-x   3 user user 4096 Nov 30 13:29 model
drwxrwxr-x   3 user user 4096 Nov 30 13:29 publish
drwxrwxr-x   3 user user 4096 Nov 30 13:29 publishers
drwxrwxr-x   2 user user 4096 Nov 30 13:29 __pycache__
-rw-rw-r--   1 user user    0 Nov 30 13:29 py.typed
drwxrwxr-x   3 user user 4096 Nov 30 13:29 renderers
drwxrwxr-x   3 user user 4096 Nov 30 13:29 test
drwxrwxr-x   5 user user 4096 Nov 30 13:29 utils
drwxrwxr-x   3 user user 4096 Nov 30 13:29 vcs
user@computer:~/project$ 
user@computer:~/project$ which shut
/home/user/.local/bin/shut
user@computer:~/project$

@NiklasRosenstein
Copy link
Owner

hey @ndejong , thanks for reporting. I'll look into that this week.

On a side note, I would actually like for shut to notice that something is poorly configured and data files will be missing in the distribution archives. Maybe I can integrate this along the way

@NiklasRosenstein NiklasRosenstein self-assigned this Nov 30, 2020
@NiklasRosenstein NiklasRosenstein added the bug Something isn't working label Nov 30, 2020
@NiklasRosenstein
Copy link
Owner

Should be fixed in 0.11.0 (75886d1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants