Skip to content

Remove pkg_resources usage #105

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions paste/util/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,12 +682,13 @@ def parse_default(tokens, name, context):
"""

def fill_command(args=None):
import sys, optparse, pkg_resources, os
import sys, optparse, os
from importlib.metadata import distribution
if args is None:
args = sys.argv[1:]
dist = pkg_resources.get_distribution('Paste')
dist = distribution('Paste')
parser = optparse.OptionParser(
version=str(dist),
version=dist.version,
usage=_fill_command_usage)
parser.add_option(
'-o', '--output',
Expand Down
9 changes: 0 additions & 9 deletions tests/cgiapp_data/form.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,11 @@ print('Content-type: text/plain')
print('')

import sys
import warnings
from os.path import dirname

base_dir = dirname(dirname(dirname(__file__)))
sys.path.insert(0, base_dir)

with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning)
try:
import pkg_resources
except ImportError:
# Ignore
pass

from paste.util.field_storage import FieldStorage

class FormFieldStorage(FieldStorage):
Expand Down