Skip to content

Commit 663b74f

Browse files
committed
fix: enable builds on Windows
Signed-off-by: Phil Adams <[email protected]>
1 parent 208c113 commit 663b74f

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ Before that, please search for similar issues. It's possible that someone has al
1212
For general guidance on contributing to this project, please see
1313
[this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/CONTRIBUTING_python.md)
1414

15+
# Prerequisites
16+
The following tools are required in order to build this project:
17+
* Git
18+
* A modern version of the `make` utility.
19+
Note: Windows users will likely need to install one of the various
20+
[make utilities available for Windows](https://www.google.com/search?q=make+utility+for+windows).
21+
* A version of [Python](https://www.python.org/downloads/) that is >= the minimum version supported by the project.
22+
Note: It is highly recommended that you use Python's `venv` module to create a virtual environment for
23+
your project. This will allow you to work on this project (including the installation of any project dependencies)
24+
without affecting your computer's Python installation or any other Python projects on your computer.
25+
More details are available [here](update_service.md#initial-project-setup).
26+
27+
Windows users might find it more convenient to use
28+
[`Windows Subsystem for Linux (WSL)`](https://learn.microsoft.com/en-us/windows/wsl/about)
29+
or [`Cygwin`](https://www.cygwin.com/) when making contributions to this project.
30+
1531
# Updating an existing service within the SDK
16-
For instructions on updating an existing service within the SDK, please see
17-
[this link](update_service.md)
32+
For instructions on updating an existing service within the SDK, please see [update_service.md](update_service.md)

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ test-examples:
3232
python -m pytest examples
3333

3434
lint:
35+
ifeq ($(OS),Windows_NT)
36+
.\pylint.bat
37+
black --check .
38+
else
3539
./pylint.sh && black --check .
40+
endif
3641

3742
lint-fix:
3843
black .

pylint.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
python -m pylint ibm_platform_services test/unit test/integration examples

update_service.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ to your external github.com id. The id linking step will also result in an invit
4949
`github.com/IBM` org. Accept that invitation.
5050
3. If you do not yet have "push" access to the SDK project, contact the project maintainer to request push access
5151
(you must be a member of the github.com/IBM org).
52-
4. Make sure that your installed version of Python is >= the minimum version supported by the SDK project.
52+
4. Make sure that you have installed the [tools required to build the project](CONTRIBUTING.md#prerequisites).
53+
5. To update a service, make sure the following additional tools are installed:
54+
* The [IBM OpenAPI Validator](https://github.com/IBM/openapi-validator)
55+
* The [IBM OpenAPI SDK Generator](github.ibm.com/CloudEngineering/openapi-sdkgen)
5356

5457
## Initial project setup
5558
1. Clone/fork the repo. If you have push access (see above), you can clone the repo directly (no fork).
@@ -75,10 +78,13 @@ git pull
7578
# create a virtual environment using the current python version, store in "./venv"
7679
python -m venv ./venv
7780

78-
# source in the resulting "activate" script to use the virtual environment
81+
# Activate the virtual environment
82+
# On Linux/MacOS source in the "activate" script created by the "venv" module:
7983
. venv/bin/activate
84+
# On Windows, run the "activate" script created by the "venv" module:
85+
venv/scripts/activate
8086

81-
# Install dependencies, run unit-tests and link-check the project
87+
# Install dependencies, run unit-tests and lint-check the project
8288
make all
8389
```
8490
4. Make sure that the integration tests and working examples run clean for your service.

0 commit comments

Comments
 (0)