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

Ideal Version of Enforcing Poetry Version #113

Open
keithrfung opened this issue Oct 1, 2020 · 2 comments
Open

Ideal Version of Enforcing Poetry Version #113

keithrfung opened this issue Oct 1, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Issues for the Hacktoberfest help wanted Extra attention is needed

Comments

@keithrfung
Copy link
Collaborator

keithrfung commented Oct 1, 2020

This issue is somewhat related to #111 and #112 . The concern is to solve issues with poetry itself, both the DockerFile and MakeFile contain a reference to a specific version of poetry. The ideal version:

Running make environment for the first time would install a specific version of poetry (call it vX.Y)
Running make environment on an existing environment would ensure the correct version of poetry is installed
The docker container would use the correct poetry version in all cases
Our linting or CI could include some verification that the lock file is generated for the correct version of poetry (I haven't looked deeply enough at the lock file to know how hard this would be).

@keithrfung keithrfung added the hacktoberfest Issues for the Hacktoberfest label Oct 1, 2020
@keithrfung keithrfung changed the title Better version of locking Poetry Version Ideal Version of Enforcing Poetry Version Oct 1, 2020
@TuTomasz
Copy link

TuTomasz commented Oct 8, 2020

I had an idea how to possibly approach this issue.

POETRY_VERSION = 1.0.10

all: environment lint start

environment:
	@echo 🔧 SETUP
	make install-gmp
	@echo Check if need cleanup
	[ -f ./.env ] && rm -r .env || echo env file not found
	[ -f ./poetry.lock ] && rm -r poetry.lock || echo lock file not found
	touch .env
	@echo Install Poetry Version $(POETRY_VERSION)
	pip install --upgrade --force-reinstall 'poetry==$(POETRY_VERSION)'
	@echo Install Dependencies
	poetry install
	@echo POETRY_VERSION==$(POETRY_VERSION) > .env

Something like this would possibly tackle the first two points of enforcing that the existing environment is always correct regenerating lock files and re-installing dependencies on version change. Also, generate .env with that specific Poetry version defined in the makefile (could be used for other future constants).

This .env file would be used in docker-compose.yml and in dockerfile to pass the correct Poetry version (other constants) when generating containers. This would ensure the third point of containers always having the right Poetry version passed. All that is taken care of when you use "make environment".

And lastly, for the fourth point, this approach regenerates a lock file on every "make environment" call so that way there shouldn't be any version conflicts and incompatible lock files. Let me know if I'm missing something here.

@lmarie79 lmarie79 added the triage Waiting to be triaged label Sep 28, 2021
@keithrfung keithrfung removed the triage Waiting to be triaged label Oct 6, 2021
@keithrfung
Copy link
Collaborator Author

@TuTomasz You really hit it out of the park with that answer. I'm sorry I missed it. This seems like right approach.

@keithrfung keithrfung added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Issues for the Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants