Skip to content

Commit 3fd748c

Browse files
committedSep 26, 2024·
Move version
1 parent 54e02a0 commit 3fd748c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed
 

‎sedr/util.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
import shapely
99

1010

11-
__version__ = "v0.7.4"
11+
__author__ = "Lars Falk-Petersen"
12+
__license__ = "GPL-3.0"
1213
edr_version = "1.1"
1314

1415

15-
def parse_args() -> argparse.Namespace:
16+
def parse_args(version: str = "") -> argparse.Namespace:
1617
"""Parse arguments."""
1718
parser = argparse.ArgumentParser(description="schemathesis-edr")
18-
parser.add_argument("-v", "--version", action="version", version=f"{__version__}")
19+
parser.add_argument("-v", "--version", action="version", version=version)
1920
parser.add_argument(
2021
"--openapi",
2122
type=str,
@@ -118,9 +119,9 @@ def parse_locations(jsondata):
118119

119120
def test_conformance_links(jsondata): # pylint: disable=unused-argument
120121
"""Test that all conformance links are valid and resolves.
122+
121123
TODO: http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/collections doesn't work, so postponing this.
122124
"""
123-
124125
# for link in conformance_json["conformsTo"]:
125126
# resp = None
126127
# try:
@@ -141,7 +142,7 @@ def parse_landing_json(jsondata) -> tuple[bool, str]:
141142
if "title" not in jsondata:
142143
return False, "Landing page does not contain a title."
143144
if "description" not in jsondata:
144-
util.logger.warning("Landing page does not contain a description.")
145+
logger.warning("Landing page does not contain a description.")
145146
if "links" not in jsondata:
146147
return False, "Landing page does not contain links."
147148
for link in jsondata["links"]:
@@ -173,3 +174,10 @@ def locate_openapi_url(url: str) -> str:
173174
# Yaml
174175
# Xml
175176
return ""
177+
178+
179+
args = logger = None
180+
181+
if __name__ == "__main__":
182+
args = parse_args()
183+
logger = set_up_logging(args=args, logfile=args.log_file)

0 commit comments

Comments
 (0)
Please sign in to comment.