8000 Make the movie lister example work on Windows by jpvandervelden · Pull Request #458 · ets-labs/python-dependency-injector · GitHub
[go: up one dir, main page]

Skip to content

Make the movie lister example work on Windows #458

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jpvandervelden
Copy link

As a Java guy I'd like to use the dependency injection in Python too. I found this library. It didn't work for me at first on Windows & VS Code. I made some changes so now it works on Linux and Windows.

Keep up the good work!

…l newline, which made the example fail on Windows.

- Changed the relative imports to absolute imports so the example works out of the box in VS Code.
- Added a shell script and a batch file to run the example on Linux and Windows.
Copy link
Member
@rmk135 rmk135 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jpvandervelden :) Thanks a lot for the contribution and glad you've figured it out how to run it on windows. I posted a couple of actions. Appreciate if you could take a look.

@@ -4,8 +4,8 @@

from dependency_injector.wiring import inject, Provide

from .listers import MovieLister
from .containers import Container
from movies.listers import MovieLister
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked for any specific behavior of relative imports on Windows, but didn't find anything. Seems like you've had a problem with it. Do you remember how you ran it and what was the problem?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a problem when using VS Code..


rm -rf wslenv2

python3 -m venv wslenv2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this is basically doing what is done in the readme, correct?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

@@ -72,3 +72,12 @@ src/dependency_injector/providers/*.so

# Workspace for samples
.workspace/
/examples/miniapps/movie-lister/wslenv2-win/Scripts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure we need these imports here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how the virtual environment is created under Windows.

@rmk135 rmk135 changed the base branch from master to develop June 4, 2021 23:58
@rmk135 rmk135 self-assigned this Jun 4, 2021
Changed script to use multiline command separator for the long command sequence.
Added some comment lines.
6FB8
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.

3 participants
0