Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_find_dists_expands_globs():
files = sorted(commands._find_dists(["twine/__*.py"]))
expected = [
os.path.join("twine", "__init__.py"),
os.path.join("twine", "__main__.py"),
]
assert expected == files
def test_find_dists_handles_real_files():
expected = [
"twine/__init__.py",
"twine/__main__.py",
"twine/cli.py",
"twine/utils.py",
"twine/wheel.py",
]
files = commands._find_dists(expected)
assert expected == files
def upload(upload_settings, dists):
dists = _find_dists(dists)
# Determine if the user has passed in pre-signed distributions
signatures = {os.path.basename(d): d for d in dists if d.endswith(".asc")}
uploads = [i for i in dists if not i.endswith(".asc")]
upload_settings.check_repository_url()
repository_url = upload_settings.repository_config['repository']
print("Uploading distributions to {}".format(repository_url))
repository = upload_settings.create_repository()
uploaded_packages = []
for filename in uploads:
package = PackageFile.from_filename(filename, upload_settings.comment)
skip_message = (
" Skipping {} because it appears to already exist".format(