This repository provides an easy way to fetch some dependencies in order to kickstart your Python project on a bare Windows machine. By using it, Scoop will be installed and configured on your computer. This in turn is then used to install Python and a virtual environment is created for it. It is possible to customize the installation process using configuration files.
To get started, follow these steps:
-
Open a PowerShell console and navigate to a (project) directory of your choice.
-
Clone this repository. (You can also achieve this by using bootstrap-installer.)
git clone https://github.com/avengineers/bootstrap.git .bootstrap
-
Run
bootstrap.ps1
to start the setup process for your project environment..\.bootstrap\bootstrap.ps1
-
Wait and enjoy the automated installation of Scoop and Python. There is a preset of default configurations which are applied during this process.
That's it! You're now ready to start developing your Python project using this repository.
-
Default settings: Without adjusting any settings in the files, the following options are used by default for the installation process:
Python settings:
- python_version = 3.11
- python_package_manager = poetry
General Scoop settings:
- scoop_installer = https://raw.githubusercontent.com/xxthunder/ScoopInstall/v1.1.0/install.ps1
- scoop_default_bucket_base_url = https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket
- scoop_python_bucket_base_url = https://raw.githubusercontent.com/ScoopInstaller/Versions/master/bucket
Scoop configuration:
- autostash_on_conflict = true
- use_lessmsi = true
- scoop_repo = https://github.com/xxthunder/Scoop.git
- scoop_branch = develop
-
How to customize the configuration: If you want to configure your own settings, you have to create a
bootstrap.json
file. The values entered there overwrite the corresponding standard settings. See the following example:{ "python_version": "3.12", "scoop_ignore_scoopfile": true, "scoop_config": { "autostash_on_conflict": false } }
This file will overwrite the corresponding entries in the default settings. A newer python version is now being used, scoopfile is ignored and autostash now applies when a conflict occurs. All the other entries remain at their default value.
-
scoopfile.json
: See the following example. Refer to the official scoop documentation for more details.{ "buckets": [ { "Name": "spl", "Source": "https://github.com/avengineers/spl-bucket" } ], "apps": [ { "Source": "spl", "Name": "mingw-winlibs-llvm-ucrt", "Version": "12.3.0-16.0.4-11.0.0-ucrt-r1" } ] }
-
pyproject.toml
: Refer to the official python documentation. Create this file in order to setup your virtual Python environment.
The entire working logic of the installation process is divided into several scripts. They will now be described in more detail:
-
bootstrap.bat
: This batch script only startsbootstrap.ps1
. -
bootstrap.ps1
: This PowerShell script is designed to be run from the command line and does not require any arguments. It is responsible for setting up the project environment by performing the following steps:- Load configuration. If no
bootstrap.json
file is provided, default settings will be used. - Install Scoop.
- Install Python using Scoop.
- When there is a
pyproject.toml
file, callbootstrap.py
to create a virtual environment.
- Load configuration. If no
-
bootstrap.py
: This Python script provides a set of classes and methods for managing a Python environment. It includes functionality for creating a new virtual environment, configuring pip settings within it, and executing arbitrary commands inside it. There is also a mechanism to check if users provide new configuration settings, so that when the script is run again, all the functionality is only triggered if something has changed.
Contributions are welcome. Please fork this repository and create a pull request if you have something you want to add or change.
This project is licensed under the MIT License - see the LICENSE.md file for details.
For any queries, please raise an issue in this repository.