Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Load Jinja2 during kytos setup #370

Closed
diraol opened this issue Apr 24, 2017 · 4 comments
Closed

Load Jinja2 during kytos setup #370

diraol opened this issue Apr 24, 2017 · 4 comments
Assignees
Milestone

Comments

@diraol
Copy link
Contributor

diraol commented Apr 24, 2017

After solving #357 we still have an error during our setup.

Jinja2 is a requirement of our project (it is in requirements.txt), and is correctly installed by the setup procedure (python setup.yp install).
But as it is also used/loaded on the setup script, we are facing a timing problem.

The available (installed) modules from PYTHONPATH are loaded on the beginning of the setup.py script. During this script, all requirements are installed, including the Jinja2 package. But the available modules (sys.path) are not reloaded, thus Jinja2 is not available to be used inside the setup.py script, which raises an error during the install procedure.

If the setup is run again, everything works fine (since Jinja2 was installed on the first run).

So, we need to figure out how to load (import) jinja2 on the setup.py script "on the runtime".

diraol pushed a commit to diraol/kytos that referenced this issue Apr 24, 2017
This is a workaround for kytos#357 and also for pypa/setuptools#456

We do still need to solve kytos#370 (jinja2 loading during setup)
diraol pushed a commit to diraol/kytos that referenced this issue Apr 24, 2017
This is a workaround for kytos#357 and also for pypa/setuptools#456

We do still need to solve kytos#370 (jinja2 loading during setup)

FIX kytos#357
@diraol diraol added this to the 2017.1b2 milestone Apr 24, 2017
diraol pushed a commit to diraol/kytos that referenced this issue Apr 24, 2017
diraol pushed a commit to diraol/kytos that referenced this issue Apr 24, 2017
@diraol diraol self-assigned this Apr 24, 2017
@beraldoleal
Copy link
Member

@diraol try... except... import on proper place will not work ? Besides that.. We have to figure out what is the best way to get values from "user/config file" during setup procedure.

@diraol
Copy link
Contributor Author

diraol commented Apr 25, 2017

@beraldoleal we can use a try/except over there, no problem. But if the Jinja2 package was installed during the install procedure it will not be available to the importer on any part of the setup script without reloading the packages available on the sys.path.

Regarding the "user/config file", I didn't understood what value should we get from user/config file that would alter anything related to this issue....

@beraldoleal
Copy link
Member

beraldoleal commented Apr 25, 2017

@diraol exact.

try:
  import jinja2
except ImportErrorBlabla:
  do your function to insert to the path here

Makes sense ?

@diraol
Copy link
Contributor Author

diraol commented Apr 25, 2017

Yeap, no problems with that. =)

beraldoleal added a commit that referenced this issue Apr 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants