eyeseast / python-frontmatter

Parse and manage posts with YAML (or other) frontmatter
http://python-frontmatter.rtfd.io
MIT License
329 stars 43 forks source link

Version 1.1.0 is missing the py.typed marker #112

Open xen0n opened 8 months ago

xen0n commented 8 months ago

Hi, first of all, thanks for making this nice library!

I just saw #110 and the new release which is nice, but mypy on my project still complains about missing type stubs or py.typed marker. Indeed the marker file seems missing in the PyPI source tarball or wheel. The file needs to be explicitly included in the setup.py machinery.

Would someone step up and fix it? (I didn't write Python for 5+ years, so I completely forgot how to do that with traditional setup.py setups. With Poetry it's a simple include = [".../py.typed"] though...)

merwok commented 8 months ago

It should be installed because there is include_package_data=True, but maybe it’s not even packaged because it’s not in MANIFEST.in

arjache commented 7 months ago

Recent versions of setuptools will include this file automatically: https://github.com/pypa/setuptools/pull/4021/files

I ran python setup.py sdist bdist_wheel with a new setuptools and verified the file was copied:

adding 'frontmatter/py.typed'

I think the problem is that the GitHub Actions publish workflow is using an older setuptools. This log shows it's using an already installed version: https://github.com/eyeseast/python-frontmatter/actions/runs/7546165876/job/20543352625#step:5:12

You might be able to fix this by changing this line to pip install --upgrade setuptools wheel twine: https://github.com/eyeseast/python-frontmatter/blob/025a94c284ad0a050851eeffebbf527c9c055fe3/.github/workflows/publish.yml#L47-L49

I'd offer to submit a PR, but for obvious reasons I wouldn't be able to verify any changes.