PyPI Package (pip) Command Line tool #42
Replies: 6 comments 4 replies
-
I'll just look into implementing it, I'd rather be able to learn to do it myself |
Beta Was this translation helpful? Give feedback.
-
Yeah fine! |
Beta Was this translation helpful? Give feedback.
-
Setting up a pypi package would make cross-platform installation much easier. I would also recommend setting up a poetry toml file (make sure to add |
Beta Was this translation helpful? Give feedback.
-
Seems interesting.. |
Beta Was this translation helpful? Give feedback.
-
This may help: https://towardsdatascience.com/how-to-publish-a-python-package-to-pypi-7be9dd5d6dcd |
Beta Was this translation helpful? Give feedback.
-
pr for poetryso i create #459 and it is recently closed reason #459 (comment)
so
based on comment above, i assume thiojoe would use other packaging setup like setup.py or pdm i don't know about pdm vs poetry but these article may help choosing poetry over setup.py https://nanthony007.medium.com/stop-using-pip-use-poetry-instead-db7164f4fc72 https://hackersandslackers.com/python-poetry-package-manager/ discussion and packagingthis could help following discussion entry pointnote: this section taken from pr discussion i try to add entry point like this python-poetry.org/docs/pyproject/#scripts but it require to run a function but in YTSpammerPurge.py it is hidden under e: if i try to add [tool.poetry.scripts]
YTSpammerPurge = 'YTSpammerPurge' it will raise error when run with poetry > poetry run YTSpammerPurge
ValueError
not enough values to unpack (expected 2, got 1)
at ~/.local/pipx/venvs/poetry/lib/python3.9/site-packages/poetry/console/commands/run.py:36 in run_script
32│ def run_script(self, script, args):
33│ if isinstance(script, dict):
34│ script = script["callable"]
35│
→ 36│ module, callable_ = script.split(":")
37│
38│ src_in_sys_path = "sys.path.append('src'); " if self._module.is_in_src() else ""
39│
40│ cmd = ["python", "-c"] recommendation diff --git a/YTSpammerPurge.py b/YTSpammerPurge.py
index 79ef3de..e30fd74 100644
--- a/YTSpammerPurge.py
+++ b/YTSpammerPurge.py
@@ -1494,7 +1494,7 @@ def main():
# Runs the program
-if __name__ == "__main__":
+def run_main()
# #For speed testing
# import cProfile
@@ -1585,3 +1585,5 @@ if __name__ == "__main__":
else:
print("\nFinished Executing.")
+if __name__ == '__main__':
+ run_main() this way i can put [tool.poetry.scripts]
YTSpammerPurge = 'YTSpammerPurge:run_main' it is still not enough for packaging but can be used in the future current structurenow the program assume all asset/config in current directory so it harder to package it imo the program need cli parameter or some input and have user set the option which file go where |
Beta Was this translation helpful? Give feedback.
-
We can make a PyPI package So that people can install it.
pip install YouTube-Spammer-Purge
.YouTube-Spammer-Purge
in the terminal/CMD And the script will start.If we do that, people can't get a Browser download warning or windows exe running warning.
I have some experience in making PIP in making python libraries.
Helloworldpy
is my simple PyPi (pip) package. we can run it through terminal Source Code , PyPI package linkCan I make
Pull Requests
? If implemented that feature?Beta Was this translation helpful? Give feedback.
All reactions