Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

fix: Adjust typehinting for project packaging #344

Merged
merged 2 commits into from
Mar 4, 2022

Conversation

AstreaTSS
Copy link
Contributor

@AstreaTSS AstreaTSS commented Feb 28, 2022

What type of pull request is this?

  • Non-breaking code change
  • Breaking code change
  • Documentation change/addition
  • Tests change

Description

#174 was wrongly thought to make sure .pyi files were being included when installing Dis-Snek from PIP. To an extent, it did, as using pip install . in the Dis-Snek project itself would work but installing it from a wheel or using PyPI would not include these files.

This PR fixes that, making sure those files are included while building the package.

EDIT: as per request, py.typed has also been fixed.

Changes

  • Remove package_data from setup.py and use include_package_data instead.
    • Globbing was not the way and it seems like setup.py ignored it.
  • Create MANIFEST.in for include_package_data and make it include .pyi files (and some other basic files).
  • EDIT: Move py.typed to the correct spot and add it to MANIFEST.in.

Checklist

  • I've formatted my code with Black
  • I've ensured my code works on Python 3.10.x
  • I've tested my code

Additional Note

EDIT: The below note has been adjusted for in this PR now, as per request.

While doing this PR, I found out we technically don't have a py.typed, which is why it's not included in MANIFEST.in. That probably needs to be added in a separate PR, though I can add it here if needed.

@benwoo1110 benwoo1110 added the Bug::Library A bug in the library label Mar 1, 2022
@silasary
Copy link
Collaborator

silasary commented Mar 1, 2022

We do have a py.typed, it's just not in the right place :/
https://github.com/Discord-Snake-Pit/Dis-Snek/blob/master/py.typed

@LordOfPolls
Copy link
Member

re @silasary and additional note

imo that should probs be included in this pr

@AstreaTSS AstreaTSS changed the title fix: Include pyi files during package building fix: Adjust typehinting for project packaging Mar 1, 2022
@AstreaTSS
Copy link
Contributor Author

re @silasary and additional note

imo that should probs be included in this pr

And included! The PR name (and description) has also been adjusted so that it makes sense.

@LordOfPolls LordOfPolls merged commit 79f4d7b into NAFTeam:dev Mar 4, 2022
@AstreaTSS AstreaTSS deleted the pyi-fix branch March 5, 2022 18:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug::Library A bug in the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants