Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8371520
Added PS script to build cloudbase-init from sources
ader1990 Apr 8, 2020
8d7f31b
Fixed empty args
ader1990 Apr 9, 2020
9051283
Hacks to make embed python work
ader1990 Apr 9, 2020
94c20bd
added easy install wheel and pip from sources
ader1990 Apr 9, 2020
f528805
Addde pip / wheel params for sources
ader1990 Apr 9, 2020
2d528fa
Parameterize python version header
ader1990 Apr 9, 2020
9c462c0
Update the bdist_wininst.py from the embedded version with the full one
ader1990 Apr 9, 2020
9bd4000
Removed hardcoded py prefix
ader1990 Apr 9, 2020
9790f7c
Build dll lib from the existend python dll
ader1990 Apr 9, 2020
3df14c6
fix some comments
ader1990 Apr 9, 2020
22ab71d
Uncomment Setup-PythonPip
ader1990 Apr 9, 2020
93bed4b
Fixed some new lines and updated readme
ader1990 Apr 9, 2020
e13e131
Added support to build Python from sources
ader1990 Apr 10, 2020
dc0b987
Added better parameters and cleanup noop
ader1990 Apr 13, 2020
1cb3a43
Fix readme headers
ader1990 Apr 13, 2020
7add7f0
Fixes after refactor
ader1990 Apr 13, 2020
0cfdc7d
Added test config for empty metadata source
ader1990 Apr 13, 2020
668a528
Added proper cleanup for the build artifacts
ader1990 Apr 13, 2020
0779fa5
Added how to for Python from source / embedded
ader1990 Apr 13, 2020
bf6746e
Added base usage
ader1990 Apr 13, 2020
e15079c
Use python directly for install and cleanup pip cache dir
ader1990 Apr 13, 2020
e77d758
Removed Embedded python install
ader1990 Apr 13, 2020
6def5c0
Merge pull request #2 from ader1990/build_from_source_cbsinit_devel
ader1990 Apr 14, 2020
315d643
Set Windows SDK to 8.1 using vcvarsall
ader1990 Apr 14, 2020
1a1ba6f
Add parameter to remove unnecessary executables
ader1990 Apr 14, 2020
2935d70
Add flag to remove adodbapi from pywin32 code
ader1990 Apr 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions scripts/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
### Requirements ###

#### Clean Windows Server 2016 / 2019 or Windows 10 install with latest updates

#### Python installed and added to path (with pip installed) if PythonOrigin is set to AlreadyInstalled.
Download link: https://www.python.org/ftp/python/3.7.7/python-3.7.7-amd64.exe

#### Visual Studio 2015 Community installed, with the following components:
- Programming Languages -> Visual C++ (all)
- Windows and Web Development -> Windows 8.1 (only Tools and Windows SDKs)

VS 2015 Download page (you need to be logged in to access it): https://visualstudio.microsoft.com/vs/older-downloads/
If you prefer to not build pywin32, Visual Studio 2017 / 2019 can be used too.
Reboot after VS installation is complete.

Choose a reason for hiding this comment

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

7-zip is also needed

#### To build Python from source, Visual Studio 2017 Community installed with the following components:
- VC++ 2017 v141
- Windows 10 SDK (10.0.14393.0). This version of VS supports Python 3.8 build too.

#### All the Python packages will be built and installed using pip flags: "--no-binary :all:"

#### The full build of cloudbase-init (and dependencies) using Python from source takes around 20 minutes.

#### How to run:


```powershell
# install Cloudbase-Init using Python already installed (Python and Python scripts folders should be added to path).
.\build_install_from_sources.ps1

# install Cloudbase-Init using Python from source (tag v3.7.7)
.\build_install_from_sources.ps1 -PythonOrigin FromSource -PythonVersion "v3.7.7"

# full command line

Choose a reason for hiding this comment

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

I'd put the full command line after the other basic examples

.\build_install_from_sources.ps1 `
-CloudbaseInitRepoUrl "https://github.com/cloudbase/cloudbase-init" `
-PyWin32RepoUrl "https://github.com/mhammond/pywin32" `
-PyMiRepoUrl "https://github.com/cloudbase/PyMI" `
-PythonOrigin "AlreadyInstalled" `
-PythonVersion "v3.7.7" `
-SetuptoolsUrl "https://github.com/pypa/setuptools" `
-PipSourceUrl "https://github.com/pypa/pip/archive/20.0.2.tar.gz" `
-WheelSourceUrl "https://github.com/pypa/wheel/archive/0.34.2.tar.gz" `,
-CleanBuildArtifacts:$false,
-RemoveUnnecessaryExecutables:$false,
-RemovePyWin32Adodbapi:$false,
-BuildDir "build"
```


#### Workflow of the script:
- Download and set pip upper requirements from OpenStack
- Create / clean temporary build directory
- If PythonOrigin="AlreadyInstalled" is set, do nothing. Python should be already installed and added to path.
- If PythonOrigin="FromSource" is set, download the Python source from GitHub, build, prepare it and add it to path. Setuptools, pip and wheel will be built from source and installed.
- Build and install PyWin32 from sources
- Build and install PyMI from sources
- Build, install and create Cloudbase-Init binary from sources
- If CleanBuildArtifacts is set and PythonOrigin is FromSource, cleanup the .pdb, .pyc, header files.
- If RemoveUnnecessaryExecutables is set and PythonOrigin is FromSource, remove the .exe files (excluding python.exe, setuptools/pip/wheel and cloudbase-init.exe).
- If RemovePyWin32Adodbapi is set, remove the Adodbapi sources and references from PyWin32 source code
Loading