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

Allow direct reading of pyproject.toml version when package not installed #2481

Closed
wants to merge 1 commit into from

Conversation

usingtechnology
Copy link
Contributor

@usingtechnology usingtechnology commented Sep 7, 2023

Slight tweak to the package version read. See #2471

When running locally, without poetry (ie devcontainer), the pytests need to read the version but the aries-cloudagent package is not installed. This will read the value from the pyproject.toml directly if package not found.

Built images will read from the installed package metadata, but pytests (run locally) read from pyproject.toml.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@dbluhm
Copy link
Contributor

dbluhm commented Sep 7, 2023

I'm okay with this workaround but can't help but wonder if it would be better to install the package with poetry in the devcontainer?

@usingtechnology
Copy link
Contributor Author

That would be ideal, but can't tell the container to use the poetry virtual env to be the containers python (at least I couldn't figure it out). You can make any command/task you want use poetry but the built-in facilities - running the pytests - don't/can't use the virtual env :(

@dbluhm
Copy link
Contributor

dbluhm commented Sep 7, 2023

Apologies if this is naive (I don't use the devcontainer setup in my environment (yet lol)): is this perhaps a workaround? https://www.richtman.au/blog/poetry-package-development-with-vscode-devcontainers/

@usingtechnology
Copy link
Contributor Author

Thanks for that. Let's pin this for now and I will explore what you've found. Looks promising! Going to set this to draft (in case anyone needs this for immediate help).

@usingtechnology usingtechnology marked this pull request as draft September 7, 2023 18:06
@usingtechnology
Copy link
Contributor Author

I'm going to close this, I did find a more acceptable workaround that is limited to devcontainer code.

Basically, do a separate call to pip3 install aries-cloudagent ( we do the same to install behave and black ) to the devcontainer and the pytests pick up the version since the package can be resolved. It still runs the local source for the tests...

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.

2 participants