Skip to content

Commit

Permalink
Fix new argument access and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danigm committed Mar 21, 2024
1 parent e57308d commit 19156aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 4 additions & 9 deletions py2pack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,8 @@ def generate(args):
tr = str.maketrans('-.', '__')
version = args.version
name = args.name
try:
source_glob = args.source_glob
except AttributeError:
source_glob = '%{name}-%{version}.*'
default_source = '%{name}-%{version}.*'
source_glob = args.source_glob or default_source
data_name = data['name'] or name

tarball_file = []
Expand Down Expand Up @@ -396,11 +394,8 @@ def generate(args):


def fetch_data(args):
try:
localfile = args.localfile
local = args.local
except AttributeError:
localfile = local = ''
localfile = args.localfile
local = args.local

if not localfile and local:
localfile = f'{args.name}.egg-info/PKG-INFO'
Expand Down
3 changes: 3 additions & 0 deletions test/test_py2pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class Args:
name = "py2pack"
version = "0.4.4"
source_url = None
source_glob = None
local = False
localfile = ""

self.args = Args()

Expand Down
3 changes: 3 additions & 0 deletions test/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Args(object):
name = ''
version = ''
source_url = None
source_glob = None
local = False
localfile = ''


compare_dir = os.path.join(os.path.dirname(__file__), 'examples')
Expand Down

0 comments on commit 19156aa

Please sign in to comment.