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

Version 1.4 and 1.3.1 don't install commands. #219

Closed
fx-kirin opened this issue Dec 5, 2022 · 6 comments
Closed

Version 1.4 and 1.3.1 don't install commands. #219

fx-kirin opened this issue Dec 5, 2022 · 6 comments

Comments

@fx-kirin
Copy link

fx-kirin commented Dec 5, 2022

Version 1.4.0 and 1.3.1 don't have scripts in setup.py in its package in PYPI. I check in the source code in PYPI website. So there is no installation of gitz related commands with these versions.

@rec
Copy link
Owner

rec commented Dec 5, 2022

URGH, I am teh stupid. Yes, I moved to using Poetry in all my projects fairly recently and I'll bet I simply forgot to put the most important section for this project!

I'll fix this ASAP, probably in the next couple of hours.

Thanks for finding and reporting this!!!

@rec
Copy link
Owner

rec commented Dec 5, 2022

Well, bad news. Poetry doesn't directly allow you to deploy scripts, WTF? python-poetry/poetry#241 (it meanders into unrelated things, how annoying.)

Their "scripts" https://python-poetry.org/docs/pyproject/#scripts allows you to deploy a Python name as some script that they package, but gitz tools are stand-alone executables without the .py suffix, so there's no way to get to them that way.

There's a plug-in that will handle this supposedly but I'm out of time.

More tonight or tomorrow.

@fx-kirin
Copy link
Author

fx-kirin commented Dec 5, 2022

Thanks for your quick response. I got curious and I checked how it went.

This has already been implemented but they said it's not been documented yet. python-poetry/poetry-core#40

I also confirmed if it worked like the pyproject.toml file bellow with these commands poetry build and pip install -e ..

[tool.poetry]
name = "myp"
version = "0.1.0"
description = ""
authors = ["fx_kirin <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"

[tool.poetry.scripts]
mpy = {reference="sample.py", type="file"}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Interestingly, scripts name mpy is only used in poetry run. The file sample.py will be stored in bin folder. So global shell command will be sample.py in this case.

Nowadays, I feel a lot has been changing about pip and setuptools and I don't really like these changes because sometimes it really confusing like this case. I hope this comment will help.

@rec
Copy link
Owner

rec commented Dec 5, 2022

All right, your work made it near-trivial!

Try out v1.4.1 and let me know if it works.

@fx-kirin
Copy link
Author

fx-kirin commented Dec 6, 2022

Thanks!

@fx-kirin fx-kirin closed this as completed Dec 6, 2022
@rec
Copy link
Owner

rec commented Dec 6, 2022

Any time!

PLEASE let me know if you have any comments or questions. I've used this library successfully for many years, I know there are a few others who do too, there are unit tests, but I know it hasn't been adequately tested on a wide range of systems, so I'd love to see more edge cases.

Thanks for your help!!!

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

No branches or pull requests

2 participants