Skip to content

Commit 6395ae1

Browse files
authored
fix: enable builds on Windows (#215)
Signed-off-by: Phil Adams <[email protected]>
1 parent 208c113 commit 6395ae1

File tree

5 files changed

+42
-18
lines changed

5 files changed

+42
-18
lines changed

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ disable=too-many-arguments,
6161
useless-suppression,
6262
deprecated-pragma,
6363
use-symbolic-message-instead,
64-
invalid-name
64+
invalid-name,
65+
global-statement
6566

6667
# Enable the message, report, category or checker with the given id(s). You can
6768
# either give multiple identifier separated by comma (,) or put this option

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: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,42 @@
22
# to be ready for development work in the local sandbox.
33
# example: "make setup"
44

5+
PYTHON=python
6+
LINT_DIRS=ibm_platform_services test examples
7+
58
setup: deps dev_deps install_project
69

710
all: upgrade_pip setup test-unit lint
811

912
ci: setup test-unit lint
1013

1114
upgrade_pip:
12-
python -m pip install --upgrade pip
15+
${PYTHON} -m pip install --upgrade pip
1316

1417
deps:
15-
python -m pip install -r requirements.txt
18+
${PYTHON} -m pip install -r requirements.txt
1619

1720
dev_deps:
18-
python -m pip install -r requirements-dev.txt
21+
${PYTHON} -m pip install -r requirements-dev.txt
1922

2023
install_project:
21-
python -m pip install -e .
24+
${PYTHON} -m pip install -e .
2225

2326
test: test-unit test-int
2427

2528
test-unit:
26-
python -m pytest --cov=ibm_platform_services test/unit
29+
${PYTHON} -m pytest --cov=ibm_platform_services test/unit
2730

2831
test-int:
29-
python -m pytest test/integration
32+
${PYTHON} -m pytest test/integration
3033

3134
test-examples:
32-
python -m pytest examples
35+
${PYTHON} -m pytest examples
3336

3437
lint:
35-
./pylint.sh && black --check .
38+
${PYTHON} -m pylint ${LINT_DIRS}
39+
black --check ${LINT_DIRS}
3640

3741
lint-fix:
38-
black .
42+
black ${LINT_DIRS}
43+

pylint.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

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)