Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how third parties use our undocumented/unsupported APIs #665

Open
di opened this issue Jun 15, 2020 · 12 comments
Open

Document how third parties use our undocumented/unsupported APIs #665

di opened this issue Jun 15, 2020 · 12 comments

Comments

@di
Copy link
Member

di commented Jun 15, 2020

In #659 it was pointed out that some third parties use twine's undocumented/unsupported APIs and that certain changes and refactoring should not be made as it might break their usage.

@sigmavirus24 said:

I've worked hard to keep things stable until someone had the time to build the real API.

In the interest of maintaining that stability, I think we should attempt to document how various third-parties are currently using this unsupported API, so we can continue to support them until there is a supported API available, and so that contributors are aware what can and cannot be changed.

List of externally used methods

twine.cli.dispatch

twine.utils.DEFAULT_REPOSITORY, twine.utils.TEST_REPOSITORY

@sigmavirus24
Copy link
Member

buildout uses twine iirc

@sigmavirus24
Copy link
Member

I think https://github.com/wbond/oscrypto/blob/master/dev/release.py insists on never using a CLI and always importing unsupported interfaces in all of their projects (this being one example)

@di
Copy link
Member Author

di commented Jun 15, 2020

Looks like oscrypto is using twine.cli.dispatch as well, I've added it above.

I couldn't find any reference to twine in buildout: https://github.com/buildout/buildout/search?q=twine

@sigmavirus24
Copy link
Member

oscrypto was just the project I recalled. I think all of wbond's projects use the same infrastructure/project skeleton

@bhrutledge
Copy link
Contributor

I added hatch to the list.

@sigmavirus24
Copy link
Member

I'm not seeing it in the issue @bhrutledge

@bhrutledge
Copy link
Contributor

@sigmavirus24 It's in the description of this issue, under "Other uses"

@di
Copy link
Member Author

di commented Jun 16, 2020

Besides DEFAULT_REPOSITORY/TEST_REPOSITORY, it looks like hatch is just using one of the entry points we've explicitly defined:

twine/setup.cfg

Lines 50 to 54 in 895ac8a

[options.entry_points]
twine.registered_commands =
check = twine.commands.check:main
upload = twine.commands.upload:main
register = twine.commands.register:main

Do we consider that to be an unsupported use of an internal API?

@sigmavirus24
Copy link
Member

Those entry points are for us to use so I'd hope they're not using them directly. Also https://github.com/ofek/hatch/blob/666fc1a1b383cf9c882720bbb90a5cdf4d7b8110/hatch/commands/release.py#L114-L115 is shelling out from within python so I don't consider that a problem. python -m twine is a valid way of invoking the tool

@di
Copy link
Member Author

di commented Jun 16, 2020

I'm confused. Invoking twine like python -m twine upload invokes the entrypoint main in twine.commands.upload. Hatch is using that entrypoint, if it wasn't defined in twine/setup.cfg calling python -m twine upload would fail.

Edit: I see what you're saying now.

@bhrutledge bhrutledge changed the title Proposal: Document how third parties use our undocumented/unsupported APIs Document how third parties use our undocumented/unsupported APIs Jun 17, 2020
@duckinator
Copy link

bork uses from twine.cli import dispatch as twine_dispatch, same as zest.releaser.

@di
Copy link
Member Author

di commented Jun 25, 2020

Thanks! Added.

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

No branches or pull requests

4 participants