From fea2ba4a630a467c515a0a3b4f4bca44274e1985 Mon Sep 17 00:00:00 2001 From: Robert-André Mauchin Date: Apr 20 2021 15:27:06 +0000 Subject: Don't error out on unknown Forge Instead warn the user that they will need to configure it manually. --- diff --git a/go2rpm/__init__.py b/go2rpm/__init__.py index a282aa3..a00cf5e 100644 --- a/go2rpm/__init__.py +++ b/go2rpm/__init__.py @@ -1,3 +1,3 @@ from rust2rpm import licensing -__version__ = '1.4.1' +__version__ = "1.4.2" diff --git a/go2rpm/__main__.py b/go2rpm/__main__.py index 3426f63..fb086c8 100644 --- a/go2rpm/__main__.py +++ b/go2rpm/__main__.py @@ -549,7 +549,9 @@ def main(): known_forge = ("github.com", "gitlab.com", "bitbucket.org", "pagure.io") known_forge_re = r"^(" + r"|".join(re.escape(url) for url in known_forge) + r")" if not re.search(known_forge_re, goipath) and args.forge is None: - parser.error(f"forge URL is required for import path other than {known_forge}") + print( + f"The forge provided is not known by go-rpm-macros. You will have to provide the source and archive parameters manually." + ) if args.forge is None: forge = "https://" + goipath diff --git a/setup.py b/setup.py index df42b5f..e837602 100644 --- a/setup.py +++ b/setup.py @@ -3,13 +3,14 @@ from setuptools import setup def read_version(path): - with open(path, 'rt') as f: + with open(path, "rt") as f: for line in f: - if line.startswith('__version__'): + if line.startswith("__version__"): return line.split("'")[1] raise IOError -version = read_version('go2rpm/__init__.py') + +version = read_version("go2rpm/__init__.py") ARGS = dict( name="go2rpm", @@ -17,7 +18,6 @@ ARGS = dict( description="Convert Go packages to RPM", license="MIT", keywords="go golang rpm", - packages=["go2rpm"], package_data={ "go2rpm": [ @@ -26,18 +26,15 @@ ARGS = dict( ], }, entry_points={ - "console_scripts": [ - "go2rpm = go2rpm.__main__:main" - ], + "console_scripts": ["go2rpm = go2rpm.__main__:main"], }, install_requires=[ # CLI tool "aiohttp", "gitpython", "jinja2", - "rust2rpm" + "rust2rpm", ], - author="Robert-André Mauchin", author_email="zebob.m@gmail.com", url="https://pagure.io/GoSIG/go2rpm",