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

Basic add command #9

Closed
cnpryer opened this issue Aug 27, 2022 · 14 comments · Fixed by #227
Closed

Basic add command #9

cnpryer opened this issue Aug 27, 2022 · 14 comments · Fixed by #227
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cnpryer
Copy link
Owner

cnpryer commented Aug 27, 2022

huak add

Run huak add to add a new dependency to the pyproject.toml and install it to a virtual environment.

The first iteration of this command would wrap pip to install the dependency and allow --dev to indicate it's a dev dependency. If a virtual environment doesn't exist then one will be generated.

@cnpryer cnpryer added this to the Initial release milestone Aug 27, 2022
@cnpryer cnpryer changed the title Add command Basic add command Aug 31, 2022
@cnpryer cnpryer self-assigned this Sep 2, 2022
@cnpryer
Copy link
Owner Author

cnpryer commented Sep 2, 2022

There are a few ways to do this, each varying in difficulty and robustness. Since the goal for the initial poc-like alpha is to just get the structure right, make it modular, and selectively choose features to "Go Rust" with:

a. Just use the Venv to parse the version string from the stdout (or potentially use RustPython).
b. Use PyPI API to get metadata before adding to the toml and installing.

@cnpryer cnpryer removed their assignment Sep 2, 2022
@cnpryer cnpryer modified the milestone: PoC Sep 11, 2022
@0101coding
Copy link
Contributor

Hey, Can I pick this?

@cnpryer
Copy link
Owner Author

cnpryer commented Sep 12, 2022

Sure!

@cnpryer
Copy link
Owner Author

cnpryer commented Sep 15, 2022

Hey just a heads up I'm starting to lean towards just setting up some PyPI integration (#34). That would be useful for this and #11.

@0101coding
Copy link
Contributor

I am making a call to pypi to retrieve the file info. When the user runs cargo add typer, a call is made to https://pypi.org/pypi/typer/json.
I am able to deserialize the response to local struct, but I am only trying to figure how to retrieve the latest version of the package, and then know where to download the package.

@cnpryer
Copy link
Owner Author

cnpryer commented Sep 15, 2022

Nice! Love it.

Can we do this in something like huak::package::metadata or something?

@cnpryer
Copy link
Owner Author

cnpryer commented Sep 15, 2022

I'm not opposed to doing huak::package::manifest either.

@0101coding
Copy link
Contributor

ok then

@0101coding
Copy link
Contributor

Hi @cnpryer Does add add the package and version to the toml file. I am leveraging what happens with the install command after getting the metadata/manifest

@cnpryer
Copy link
Owner Author

cnpryer commented Sep 20, 2022

I am leveraging what happens with the install command after getting the metadata/manifest

hmm what do you mean by this? add should add the installed package to the pyproject. --dev should add it under dev-dependencies.

@cnpryer
Copy link
Owner Author

cnpryer commented Sep 20, 2022

Hey I'm happy to help out with this! Feel free to submit a draft PR. I can check it out.

If not this has been on my agenda for a bit and would be related to #34. I could hop on this soon.

@0101coding
Copy link
Contributor

I am leveraging the implementation already in install command. I will create a draft PR so you get an idea of what I am referring to

@cnpryer
Copy link
Owner Author

cnpryer commented Sep 25, 2022

Hey! Thanks again for helping! I see you closed your PR. Would you like for me to take this?

@0101coding
Copy link
Contributor

That happened because I was trying to discard my commit since it was not in sync with your master upstream. Wasn't expecting that to happen. I thought it should just discard the commit

This was referenced Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants