From 257a83fc5219a871e22f8ef561ba6ccd9b19573c Mon Sep 17 00:00:00 2001 From: Leodanis Pozo Ramos Date: Tue, 1 Apr 2025 17:46:22 +0200 Subject: [PATCH 1/5] Sample code for the article on `uv` --- python-uv/README.md | 3 + python-uv/main.py | 73 +++++++++++++++++++++ python-uv/pyproject.toml | 21 ++++++ python-uv/uv.lock | 137 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 234 insertions(+) create mode 100644 python-uv/README.md create mode 100644 python-uv/main.py create mode 100644 python-uv/pyproject.toml create mode 100644 python-uv/uv.lock diff --git a/python-uv/README.md b/python-uv/README.md new file mode 100644 index 0000000000..a4f7d38d9a --- /dev/null +++ b/python-uv/README.md @@ -0,0 +1,3 @@ +# Managing Python Projects With `uv`: An All-in-One Solution + +This folder provides the code examples for the Real Python tutorial [Managing Python Projects With `uv`: An All-in-One Solution](https://realpython.com/python-uv/). diff --git a/python-uv/main.py b/python-uv/main.py new file mode 100644 index 0000000000..33418d6b6a --- /dev/null +++ b/python-uv/main.py @@ -0,0 +1,73 @@ +import argparse + +import requests + +WEATHER_EMOJIS = { + "clear": "☀️", + "sunny": "☀️", + "cloudy": "☁️", + "partly cloudy": "⛅", + "rain": "🌧️", + "light rain": "🌦️", + "heavy rain": "🌊", + "storm": "🌩️", + "snow": "❄️", + "fog": "🌫️", + "mist": "🌫️", + "default": "🌍", +} + +API_QUERY_TEMPLATE = "https://wttr.in/{city}?format=%C+%t" + + +def get_weather_emoji(condition, weather_emojis=WEATHER_EMOJIS): + condition = condition.lower() + for key, emoji in weather_emojis.items(): + if key in condition: + return emoji + return weather_emojis["default"] + + +def get_weather(city, api_query_template=API_QUERY_TEMPLATE): + api_query = api_query_template.format(city=city) + try: + response = requests.get(api_query) + response.raise_for_status() + weather_info = response.text.strip().split("+") + if len(weather_info) < 2: + return "Error: Unexpected weather data format." + condition = weather_info[0].strip() + temperature = weather_info[1].strip() + emoji = get_weather_emoji(condition) + return f"{emoji} {condition} -> {temperature}" + except requests.RequestException: + return "Error: Could not retrieve weather data." + + +def parse_cli_args(): + parser = argparse.ArgumentParser( + prog="weather", + description="Weather information for the specified city.", + epilog="Thanks for using %(prog)s! :)", + ) + parser.add_argument( + "city", + nargs="+", + help="Name of the city to get weather information for", + ) + parser.add_argument( + "--version", + action="version", + version="%(prog)s 0.1.0", + ) + return parser.parse_args() + + +def main(): + args = parse_cli_args() + weather = get_weather(" ".join(args.city)) + print(weather) + + +if __name__ == "__main__": + main() diff --git a/python-uv/pyproject.toml b/python-uv/pyproject.toml new file mode 100644 index 0000000000..6ad30c4d27 --- /dev/null +++ b/python-uv/pyproject.toml @@ -0,0 +1,21 @@ +[project] +name = "rpweather" +version = "0.1.0" +description = "Display weather information for the specified city." +readme = "README.md" +requires-python = ">=3.13" +dependencies = [ + "requests>=2.32.3", +] + +[dependency-groups] +dev = [ + "pytest>=8.3.5", +] + +[project.scripts] +rpweather = "main:main" + +[build-system] +requires = ["setuptools>=78.1.0", "wheel>=0.45.1"] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/python-uv/uv.lock b/python-uv/uv.lock new file mode 100644 index 0000000000..c9a9808ac5 --- /dev/null +++ b/python-uv/uv.lock @@ -0,0 +1,137 @@ +version = 1 +revision = 1 +requires-python = ">=3.13" + +[[package]] +name = "certifi" +version = "2025.1.31" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1c/ab/c9f1e32b7b1bf505bf26f0ef697775960db7932abeb7b516de930ba2705f/certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651", size = 167577 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/38/fc/bce832fd4fd99766c04d1ee0eead6b0ec6486fb100ae5e74c1d91292b982/certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe", size = 166393 }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/16/b0/572805e227f01586461c80e0fd25d65a2115599cc9dad142fee4b747c357/charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3", size = 123188 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/38/94/ce8e6f63d18049672c76d07d119304e1e2d7c6098f0841b51c666e9f44a0/charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda", size = 195698 }, + { url = "https://files.pythonhosted.org/packages/24/2e/dfdd9770664aae179a96561cc6952ff08f9a8cd09a908f259a9dfa063568/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313", size = 140162 }, + { url = "https://files.pythonhosted.org/packages/24/4e/f646b9093cff8fc86f2d60af2de4dc17c759de9d554f130b140ea4738ca6/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9", size = 150263 }, + { url = "https://files.pythonhosted.org/packages/5e/67/2937f8d548c3ef6e2f9aab0f6e21001056f692d43282b165e7c56023e6dd/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b", size = 142966 }, + { url = "https://files.pythonhosted.org/packages/52/ed/b7f4f07de100bdb95c1756d3a4d17b90c1a3c53715c1a476f8738058e0fa/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11", size = 144992 }, + { url = "https://files.pythonhosted.org/packages/96/2c/d49710a6dbcd3776265f4c923bb73ebe83933dfbaa841c5da850fe0fd20b/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f", size = 147162 }, + { url = "https://files.pythonhosted.org/packages/b4/41/35ff1f9a6bd380303dea55e44c4933b4cc3c4850988927d4082ada230273/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd", size = 140972 }, + { url = "https://files.pythonhosted.org/packages/fb/43/c6a0b685fe6910d08ba971f62cd9c3e862a85770395ba5d9cad4fede33ab/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2", size = 149095 }, + { url = "https://files.pythonhosted.org/packages/4c/ff/a9a504662452e2d2878512115638966e75633519ec11f25fca3d2049a94a/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886", size = 152668 }, + { url = "https://files.pythonhosted.org/packages/6c/71/189996b6d9a4b932564701628af5cee6716733e9165af1d5e1b285c530ed/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601", size = 150073 }, + { url = "https://files.pythonhosted.org/packages/e4/93/946a86ce20790e11312c87c75ba68d5f6ad2208cfb52b2d6a2c32840d922/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd", size = 145732 }, + { url = "https://files.pythonhosted.org/packages/cd/e5/131d2fb1b0dddafc37be4f3a2fa79aa4c037368be9423061dccadfd90091/charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407", size = 95391 }, + { url = "https://files.pythonhosted.org/packages/27/f2/4f9a69cc7712b9b5ad8fdb87039fd89abba997ad5cbe690d1835d40405b0/charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971", size = 102702 }, + { url = "https://files.pythonhosted.org/packages/0e/f6/65ecc6878a89bb1c23a086ea335ad4bf21a588990c3f535a227b9eea9108/charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85", size = 49767 }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "idna" +version = "3.10" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442 }, +] + +[[package]] +name = "iniconfig" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845", size = 1450891 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820", size = 343634 }, +] + +[[package]] +name = "requests" +version = "2.32.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", size = 131218 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6", size = 64928 }, +] + +[[package]] +name = "rpweather" +version = "0.1.0" +source = { editable = "." } +dependencies = [ + { name = "requests" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "requests", specifier = ">=2.32.3" }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.3.5" }] + +[[package]] +name = "urllib3" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/aa/63/e53da845320b757bf29ef6a9062f5c669fe997973f966045cb019c3f4b66/urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d", size = 307268 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c8/19/4ec628951a74043532ca2cf5d97b7b14863931476d117c471e8e2b1eb39f/urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df", size = 128369 }, +] From d04fdc70163e939fe7b6f371c949a591ff54754a Mon Sep 17 00:00:00 2001 From: Leodanis Pozo Ramos Date: Mon, 7 Apr 2025 17:14:42 +0200 Subject: [PATCH 2/5] TR updates, first round --- python-uv/main.py | 89 ++++++++++++++++------------------------ python-uv/pyproject.toml | 14 +++++-- python-uv/uv.lock | 4 +- 3 files changed, 48 insertions(+), 59 deletions(-) diff --git a/python-uv/main.py b/python-uv/main.py index 33418d6b6a..71f35c49d1 100644 --- a/python-uv/main.py +++ b/python-uv/main.py @@ -1,73 +1,56 @@ import argparse +import sys import requests -WEATHER_EMOJIS = { - "clear": "☀️", - "sunny": "☀️", - "cloudy": "☁️", - "partly cloudy": "⛅", - "rain": "🌧️", - "light rain": "🌦️", - "heavy rain": "🌊", - "storm": "🌩️", - "snow": "❄️", - "fog": "🌫️", - "mist": "🌫️", - "default": "🌍", -} -API_QUERY_TEMPLATE = "https://wttr.in/{city}?format=%C+%t" +def get_breeds_info(): + response = requests.get("https://api.thecatapi.com/v1/breeds") + response.raise_for_status() + return response.json() -def get_weather_emoji(condition, weather_emojis=WEATHER_EMOJIS): - condition = condition.lower() - for key, emoji in weather_emojis.items(): - if key in condition: - return emoji - return weather_emojis["default"] +def find_breed_info(breed_name): + json_response = get_breeds_info() + for breed in json_response: + if breed["name"] == breed_name: + return breed + return {} -def get_weather(city, api_query_template=API_QUERY_TEMPLATE): - api_query = api_query_template.format(city=city) - try: - response = requests.get(api_query) - response.raise_for_status() - weather_info = response.text.strip().split("+") - if len(weather_info) < 2: - return "Error: Unexpected weather data format." - condition = weather_info[0].strip() - temperature = weather_info[1].strip() - emoji = get_weather_emoji(condition) - return f"{emoji} {condition} -> {temperature}" - except requests.RequestException: - return "Error: Could not retrieve weather data." +def display_breed_profile(breed): + print(f"\n{breed['name']:-^30s}") + print(f"Origin: {breed['origin']}") + print(f"Temperament: {breed['temperament']}") + print(f"Life Span: {breed['life_span']} years") + print(f"Weight: {breed['weight']['imperial']} lbs") + if breed.get("wikipedia_url"): + print(f"\nLearn more: {breed['wikipedia_url']}") -def parse_cli_args(): - parser = argparse.ArgumentParser( - prog="weather", - description="Weather information for the specified city.", - epilog="Thanks for using %(prog)s! :)", - ) - parser.add_argument( - "city", - nargs="+", - help="Name of the city to get weather information for", - ) +def parse_args(): + parser = argparse.ArgumentParser(description="Get information about cat breeds") parser.add_argument( - "--version", - action="version", - version="%(prog)s 0.1.0", + "breed", + help="Name of cat breed (e.g., 'Siamese')", ) return parser.parse_args() def main(): - args = parse_cli_args() - weather = get_weather(" ".join(args.city)) - print(weather) + args = parse_args() + try: + breed = find_breed_info(args.breed) + if not breed: + print("Breed not found. Try another breed name.") + return 0 + display_breed_profile(breed) + except Exception as e: + print(f"Error: {e}") + return 1 + + return 0 if __name__ == "__main__": - main() + sys.exit(main()) diff --git a/python-uv/pyproject.toml b/python-uv/pyproject.toml index 6ad30c4d27..036983a867 100644 --- a/python-uv/pyproject.toml +++ b/python-uv/pyproject.toml @@ -1,7 +1,7 @@ [project] -name = "rpweather" +name = "rpcats" version = "0.1.0" -description = "Display weather information for the specified city." +description = "Add your description here" readme = "README.md" requires-python = ">=3.13" dependencies = [ @@ -14,8 +14,14 @@ dev = [ ] [project.scripts] -rpweather = "main:main" +rpcats = "main:main" [build-system] requires = ["setuptools>=78.1.0", "wheel>=0.45.1"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" + +[[tool.uv.index]] +name = "testpypi" +url = "https://test.pypi.org/simple/" +publish-url = "https://test.pypi.org/legacy/" +explicit = true \ No newline at end of file diff --git a/python-uv/uv.lock b/python-uv/uv.lock index c9a9808ac5..b125b5392d 100644 --- a/python-uv/uv.lock +++ b/python-uv/uv.lock @@ -109,9 +109,9 @@ wheels = [ ] [[package]] -name = "rpweather" +name = "rpcats" version = "0.1.0" -source = { editable = "." } +source = { virtual = "." } dependencies = [ { name = "requests" }, ] From fd8ac3982d753f173e3ed26b315878f7b0a00b73 Mon Sep 17 00:00:00 2001 From: Leodanis Pozo Ramos Date: Mon, 7 Apr 2025 17:17:29 +0200 Subject: [PATCH 3/5] Fix formatting issues --- python-uv/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python-uv/main.py b/python-uv/main.py index 71f35c49d1..fe483e2972 100644 --- a/python-uv/main.py +++ b/python-uv/main.py @@ -29,7 +29,9 @@ def display_breed_profile(breed): def parse_args(): - parser = argparse.ArgumentParser(description="Get information about cat breeds") + parser = argparse.ArgumentParser( + description="Get information about cat breeds", + ) parser.add_argument( "breed", help="Name of cat breed (e.g., 'Siamese')", From a5666ead6e21fd17b1955e4958263896e3ddb976 Mon Sep 17 00:00:00 2001 From: Leodanis Pozo Ramos Date: Tue, 8 Apr 2025 19:59:45 +0200 Subject: [PATCH 4/5] TR updates, second round --- python-uv/main.py | 3 +-- python-uv/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/python-uv/main.py b/python-uv/main.py index fe483e2972..5e57de5789 100644 --- a/python-uv/main.py +++ b/python-uv/main.py @@ -15,7 +15,7 @@ def find_breed_info(breed_name): for breed in json_response: if breed["name"] == breed_name: return breed - return {} + return None def display_breed_profile(breed): @@ -50,7 +50,6 @@ def main(): except Exception as e: print(f"Error: {e}") return 1 - return 0 diff --git a/python-uv/pyproject.toml b/python-uv/pyproject.toml index 036983a867..a095b0f444 100644 --- a/python-uv/pyproject.toml +++ b/python-uv/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "rpcats" version = "0.1.0" -description = "Add your description here" +description = "Display cat information for the specified breed." readme = "README.md" requires-python = ">=3.13" dependencies = [ From 99ea39d8f6debf0653a5e4eb5387b1f97c5727ca Mon Sep 17 00:00:00 2001 From: Leodanis Pozo Ramos Date: Tue, 8 Apr 2025 20:03:08 +0200 Subject: [PATCH 5/5] Add blank line --- python-uv/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python-uv/main.py b/python-uv/main.py index 5e57de5789..542fe1750b 100644 --- a/python-uv/main.py +++ b/python-uv/main.py @@ -50,6 +50,7 @@ def main(): except Exception as e: print(f"Error: {e}") return 1 + return 0