hynek / hatch-fancy-pypi-readme Goto Github PK
View Code? Open in Web Editor NEWFancy PyPI READMEs with Hatch
License: MIT License
Fancy PyPI READMEs with Hatch
License: MIT License
I'm seeing things like this frequently:
# Replace relative paths to images with absolute paths
long_description = re.sub("website/homepage/", "https://raw.githubusercontent.com/gradio-app/gradio/main/website/homepage/", long_description)
long_description = re.sub(r"demo/([\S]*.gif)", r"https://raw.githubusercontent.com/gradio-app/gradio/main/demo/\g<1>", long_description)
maybe:
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
find = "website/homepage/"
replace = "https://raw.githubusercontent.com/gradio-app/gradio/main/website/homepage/"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
find = 'demo/([\S]*.gif)'
replace = 'https://raw.githubusercontent.com/gradio-app/gradio/main/demo/\g<1>'
Currently I had to disable the CLI health check in the dev env GitHub Action because it explodes when trying to print our readme:
2022-08-05T16:48:16.5981518Z Traceback (most recent call last):
2022-08-05T16:48:16.5989130Z File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\runpy.py", line 196, in _run_module_as_main
2022-08-05T16:48:16.6072945Z return _run_code(code, main_globals, None,
2022-08-05T16:48:16.6074114Z File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\runpy.py", line 86, in _run_code
2022-08-05T16:48:16.6074856Z exec(code, run_globals)
2022-08-05T16:48:16.6075933Z File "D:\a\hatch-fancy-pypi-readme\hatch-fancy-pypi-readme\src\hatch_fancy_pypi_readme\__main__.py", line 55, in <module>
2022-08-05T16:48:16.6076587Z main()
2022-08-05T16:48:16.6077360Z File "D:\a\hatch-fancy-pypi-readme\hatch-fancy-pypi-readme\src\hatch_fancy_pypi_readme\__main__.py", line 51, in main
2022-08-05T16:48:16.6077826Z cli_run(cfg, out)
2022-08-05T16:48:16.6078517Z File "D:\a\hatch-fancy-pypi-readme\hatch-fancy-pypi-readme\src\hatch_fancy_pypi_readme\_cli.py", line 50, in cli_run
2022-08-05T16:48:16.6079051Z print(build_text(config.fragments), file=out) # pragma: no cover
2022-08-05T16:48:16.6079572Z File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\encodings\cp1252.py", line 19, in encode
2022-08-05T16:48:16.6168727Z return codecs.charmap_encode(input,self.errors,encoding_table)[0]
2022-08-05T16:48:16.6169952Z UnicodeEncodeError: 'charmap' codec can't encode character '\u2728' in position 45: character maps to <undefined>
2022-08-05T16:48:16.8289601Z ##[error]Process completed with exit code 1.
I have no clue if this is fixable at all?
@ofek you mentioned you use Windows? ๐
If you want to reduce what you have to maintain, Hatch now can replace the CLI here https://hatch.pypa.io/latest/blog/2022/10/08/hatch-v160/#project-metadata
We can't package the new version of hatch-fancy-pypi-readme on Gentoo because it has a cyclic dependency between jsonschema and hatch-fancy-pypi-readme. Since jsonschema requires hatch-fancy-pypi-readme to build, it needs to be installed first. However, it doesn't work if it's installed prior to jsonschema and therefore it breaks the build of jsonschema:
Traceback (most recent call last):
File "/usr/lib/python-exec/pypy3/gpep517", line 4, in <module>
sys.exit(main())
File "/usr/lib/pypy3.9/site-packages/gpep517/__main__.py", line 322, in main
return func(args)
File "/usr/lib/pypy3.9/site-packages/gpep517/__main__.py", line 122, in build_wheel
print(build_wheel_impl(args, args.wheel_dir), file=out)
File "/usr/lib/pypy3.9/site-packages/gpep517/__main__.py", line 105, in build_wheel_impl
wheel_name = backend.build_wheel(str(wheel_dir), args.config_json)
File "/usr/lib/pypy3.9/site-packages/hatchling/build.py", line 59, in build_wheel
return os.path.basename(next(builder.build(wheel_directory, ['standard'])))
File "/usr/lib/pypy3.9/site-packages/hatchling/builders/plugin/interface.py", line 80, in build
self.metadata.validate_fields()
File "/usr/lib/pypy3.9/site-packages/hatchling/metadata/core.py", line 191, in validate_fields
_ = self.version
File "/usr/lib/pypy3.9/site-packages/hatchling/metadata/core.py", line 85, in version
self._set_version()
File "/usr/lib/pypy3.9/site-packages/hatchling/metadata/core.py", line 173, in _set_version
version = self.hatch.version.cached
File "/usr/lib/pypy3.9/site-packages/hatchling/metadata/core.py", line 1256, in cached
raise type(e)(f'Error getting the version from source `{self.source.PLUGIN_NAME}`: {e}') from None
ModuleNotFoundError: Error getting the version from source `vcs`: No module named 'jsonschema'
Looks like now hatch-fancy-pypi-readme
requires its own code to pass pep517 build
+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting dependencies for wheel...
ERROR Missing dependencies:
hatch-fancy-pypi-readme>=22.4.0
Why not use during build `hatch-fancy-pypi-readme1 code from build tree? ๐ค
I am packaging this module in Fedora. During its rpm packaging, fedora-review tool found that this module is installing AUTHORS.md file as /usr/lib/python3.11/site-packages/hatch_fancy_pypi_readme-22.3.0.dist-info/licenses/AUTHORS.md
But this is not a license file. Can this be corrected?
Please add a version with support for python2. Some packages relying on this package do ship 2.7-compatible source, but include this project, which ruins the whole chain. I'm trying to install a piece of software, but this, that shouldn't even affect the building of it, has completely prevented that from happening.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.