mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-10-30 17:48:09 +00:00 
			
		
		
		
	[build] Add Support For Python 3 Build
CONiC config gen requires jinja2<3.0.0 for stretch and byangbind versions 0.60.0/0.80.1 for Python 2/3 respectively. byangbind is installed in the build docker because when it installed it pulls enum34 as dependent package which is not required for Python 3 and it breaks the build. signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
This commit is contained in:
		| @@ -242,7 +242,9 @@ RUN apt-get update && apt-get install -y \ | ||||
|         sphinx-common \ | ||||
|         python3-sphinx \ | ||||
| # For sonic config engine testing | ||||
|         python-dev \ | ||||
|         python-lxml \ | ||||
|         python3-lxml \ | ||||
|         python-jinja2 \ | ||||
|         python-netaddr \ | ||||
|         python-ipaddr \ | ||||
| @@ -362,9 +364,11 @@ RUN pip install \ | ||||
|         crc16 | ||||
|  | ||||
| # For sonic config engine testing | ||||
| RUN pip install pyangbind==0.6.0 | ||||
| # Note: force upgrade debian packaged jinja2, if installed | ||||
| RUN pip install --force-reinstall --upgrade "jinja2>=2.10" | ||||
| # Install pyangbind here, outside sonic-config-engine dependencies, as pyangbind causes enum34 to be installed. | ||||
| # enum34 causes Python 're' package to not work properly as it redefines an incompatible enum.py module | ||||
| # https://github.com/robshakir/pyangbind/issues/232 | ||||
| RUN pip3 install pyangbind==0.8.1 | ||||
| RUN pip3 uninstall -y enum34 | ||||
|  | ||||
| # For templating | ||||
| RUN pip install j2cli==0.3.10 | ||||
|   | ||||
| @@ -241,7 +241,9 @@ RUN apt-get update && apt-get install -y \ | ||||
|         sphinx-common \ | ||||
|         python3-sphinx \ | ||||
| # For sonic config engine testing | ||||
|         python-dev \ | ||||
|         python-lxml \ | ||||
|         python3-lxml \ | ||||
|         python-jinja2 \ | ||||
|         python-netaddr \ | ||||
|         python-ipaddr \ | ||||
| @@ -341,10 +343,15 @@ RUN pip install \ | ||||
|         ctypesgen==0.r125 \ | ||||
|         crc16 | ||||
|  | ||||
| # Note: Stick with Jinja2 2.x branch as the 3.x dropped support for Python 2.7  | ||||
| RUN pip install --force-reinstall --upgrade "Jinja2<3.0.0" | ||||
|  | ||||
| # For sonic config engine testing | ||||
| RUN pip install pyangbind==0.6.0 | ||||
| # Note: force upgrade debian packaged jinja2, if installed | ||||
| RUN pip install --force-reinstall --upgrade "jinja2>=2.10" | ||||
| # Install pyangbind here, outside sonic-config-engine dependencies, as pyangbind causes enum34 to be installed. | ||||
| # enum34 causes Python 're' package to not work properly as it redefines an incompatible enum.py module | ||||
| # https://github.com/robshakir/pyangbind/issues/232 | ||||
| RUN pip3 install pyangbind==0.8.1 | ||||
| RUN pip3 uninstall -y enum34 | ||||
|  | ||||
| # For templating | ||||
| RUN pip install j2cli==0.3.10 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tamer Ahmed
					Tamer Ahmed