Closed maximeflya closed 2 months ago
Ah, hmm, it might need to be included in the manifest, actually...
That might help indeed. I'm just wondering how pip will install the package because currently it is just
lib/python3.11/site-packages
├─ schema-0.7.7.dist-info
│ ├── INSTALLER
│ └── ...
└─ schema.py
So there is currently no folder for schema
like other packages where the py.typed
file could be in.
From some quick testing, adding it in the MANIFEST.in
adds the py.typed
in the tar.gz
but not the wheel
and it gets discarded when installing it with pip
Hm, that's odd, I wouldn't have expected that... Unfortunately I'm not an expert in packaging, does including the file both in the package_data
key and the manifest work?
I tried and that doesn't work either. From this discussion I found, my suggestion seems to be the way to go: https://github.com/python/typing/issues/1333#issuecomment-1375180413
This would involve slightly changing the setup.py
to find the package version in schema/__init__.py
instead of schema
.
Could you please open a PR?
I see that
schema.py
is typed and it would be great to be able to use that information when running mypy. In order for that to happen, there needs to be apy.typed
file in the package.I see that there was an attempt in including it in the package: https://github.com/keleshev/schema/blob/df0d03f80554ea5de55628be4749252847c501eb/setup.py#L26 It seems to do nothing though when inspecting the
wheel
andtar.gz
(version 0.7.7): only theschema.py
file is stored.I did not try but it might work if the file structure is changed to something like this: