Skip to content

Build script for third-party distributions - #2545

Merged
srittau merged 3 commits into
python:third-party-distfrom
srittau:tp-setup
Oct 26, 2018
Merged

srittau merged 3 commits into
python:third-party-distfrom
srittau:tp-setup

Conversation

@srittau

@srittau srittau commented Oct 23, 2018

Copy link
Copy Markdown
Collaborator

Part of #2491

This script allows to build third-party stubs packages as stubs-only distributions. Usage:

python3.7 build-dist.py <package>

A wheel will be built into third-party/build/dist.

@srittau
srittau merged commit e608b2a into python:third-party-dist Oct 26, 2018
@srittau
srittau deleted the tp-setup branch October 26, 2018 08:08
@srittau

srittau commented Oct 26, 2018

Copy link
Copy Markdown
Collaborator Author

I have gone ahead and merged this even though I would like to see more reviews. But since this is merged into an experimental branch anyway, we can always make changes.

@emmatyping emmatyping left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just some more technical/fun thoughts, the bigger picture thoughts I have I am putting in #2491.


# Build a stubs-only distribution for a third-party package.
#
# Usage: python3.7 build-dist.py <PACKAGE>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure requiring people to have a 3.7 install is a good idea, but then again it doesn't bother me too much. At minimum a version check/warning before importing anything would avoid people being confused by "no module named dataclasses".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually this script is meant to be run as part of the CI process, do I didn't worry about that too much. But the version check is a good idea!

from pathlib import Path
from typing import List

DIST_SUFFIX = "-ts"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it amusing this looks like typescript :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, when I reviewed my suggestion before writing this script I wondered why I had chosen that suffix and whether I made a mistake because I had written a lot of typescript lately. Then I remembered that it was the abbreviation for typeshed. :)

That said, I think we should get the pypi maintainers on board for a final decision for a suffix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants