Skip to content

Commit 24e251f

Browse files
committed
update contributing
1 parent bef3a7a commit 24e251f

File tree

63 files changed

+29
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+29
-99
lines changed

.github/workflows/python-app.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
DEFAULT_PYTHON: "3.10"
1111
RUFF_VERSION: 0.14.10
12-
UV_VERSION: 0.9.18
12+
UV_VERSION: 0.9.22
1313

1414
permissions:
1515
contents: read
@@ -21,7 +21,9 @@ jobs:
2121
- uses: actions/checkout@v6
2222
- uses: chartboost/ruff-action@v1
2323
with:
24+
args: "check --fix"
2425
version: ${{ env.RUFF_VERSION }}
26+
# A proposal to replace black & pylint
2527
# - uses: chartboost/ruff-action@v1
2628
# with:
2729
# args: "format --check"
@@ -30,7 +32,7 @@ jobs:
3032
black:
3133
runs-on: ubuntu-latest
3234
steps:
33-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v6
3436
- uses: actions/setup-python@v3
3537
with:
3638
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -39,7 +41,7 @@ jobs:
3941
pylint:
4042
runs-on: ubuntu-latest
4143
steps:
42-
- uses: actions/checkout@v3
44+
- uses: actions/checkout@v6
4345
- uses: actions/setup-python@v4
4446
with:
4547
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -51,7 +53,7 @@ jobs:
5153
run: uv sync --frozen --all-extras
5254
- name: Run Pylint
5355
run: |
54-
uv run pylint --disable=too-many-positional-arguments office365
56+
uv run pylint office365
5557
5658
pytest:
5759
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ repos:
2727
# language: system
2828
# pass_filenames: false
2929

30+
- id: black
31+
name: black
32+
entry: uv run black .
33+
language: system
34+
pass_filenames: false
35+
3036
- id: pylint
3137
name: pylint
3238
entry: uv run pylint office365
3339
language: system
3440
pass_filenames: false
3541

36-
- repo: https://github.com/psf/black
37-
rev: 23.9.1
38-
hooks:
39-
- id: black
40-
args:
41-
- --quiet

CONTRIBUTING.md

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Welcome Contributors! 🎉
1+
# Welcome Contributors! 🎉
22

33
Thank you for your interest in contributing to the Office365-REST-Python-Client library. This project provides a comprehensive Python client for Microsoft 365 and Microsoft Graph APIs.
44

@@ -34,26 +34,17 @@ cd Office365-REST-Python-Client
3434

3535
## Development Environment Setup
3636

37-
### Virtual Environment
37+
Activate the Virtual Environment and install dependencies:
3838

3939
```bash
40-
python3 -m venv venv
41-
. venv/bin/activate # On Windows: venv\Scripts\activate
42-
```
43-
44-
### Install Dependencies
45-
46-
```bash
47-
pip install -r requirements.txt
48-
pip install -r requirements-dev.txt
40+
uv sync --all-extras
4941
```
5042

5143
### Pre-commit hooks (recommended)
5244

5345
```bash
54-
pip install pre-commit
55-
pre-commit install
56-
pre-commit run -a
46+
uv tool install prek
47+
prek run --all-files
5748
```
5849

5950
## Code Style and Quality Standards
@@ -69,9 +60,7 @@ Line length: 121 characters (configured in `pyproject.toml`).
6960
Run locally before pushing:
7061

7162
```bash
72-
black .
73-
ruff check .
74-
pylint office365
63+
prek
7564
```
7665

7766
## Testing Guidelines
@@ -82,15 +71,15 @@ Most tests are end-to-end and require actual Microsoft 365 credentials.
8271

8372
1. Create a `.env` file in the project root:
8473

85-
```bash
86-
export office365_python_sdk_securevars='{username};{password};{client_id};{client_secret}'
87-
```
74+
```bash
75+
export office365_python_sdk_securevars='{username};{password};{client_id};{client_secret}'
76+
```
8877

8978
2. Source the environment file:
9079

91-
```bash
92-
. .env
93-
```
80+
```bash
81+
. .env
82+
```
9483

9584
Note: The order of values is significant because tests parse by index.
9685

@@ -128,9 +117,9 @@ CI note: Full E2E tests in CI rely on repository secrets and may not run on fork
128117

129118
1. Create a feature branch from `master`:
130119

131-
```bash
132-
git checkout -b feature/your-feature-name
133-
```
120+
```bash
121+
git checkout -b feature/your-feature-name
122+
```
134123

135124
2. Make your changes with clear, focused commits
136125
3. Ensure all tests pass and quality checks are satisfied
@@ -180,5 +169,3 @@ This project is maintained by the community. Be respectful and constructive in a
180169
### License
181170

182171
MIT License. By contributing, you agree that your contributions are licensed under these terms.
183-
184-

examples/sharepoint/files/download_from_lib.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
download_root_path = Path(tempfile.mkdtemp())
2323

2424
for item in items:
25-
2625
download_path = download_root_path / item.properties.get("FileDirRef").lstrip("/")
2726
download_path.mkdir(parents=True, exist_ok=True)
2827

generator/generate_model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from generator import load_settings
32
from generator.builders.type_builder import TypeBuilder
43
from office365.runtime.odata.v3.metadata_reader import ODataV3Reader

office365/azure_env.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class AzureEnvironment(object):
2-
32
Global = "Global"
43
"""Referred to as Azure or Azure Global."""
54

office365/directory/serviceprincipals/service_principal.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ def _get_application_permissions(app_id):
259259
return_type.value.add(app_role)
260260

261261
def _resolve_app():
262-
263262
def _after(service_principal):
264263
_get_application_permissions(service_principal.id)
265264

office365/migration/assessment/scanners/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def wrapper(self):
3333

3434

3535
class BaseScanner(ABC, Generic[T]):
36-
3736
def __init__(self, source):
3837
# type: (T) -> None
3938
self.source = source

office365/migration/assessment/scanners/list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
class ListScanner(BaseScanner[List]):
9-
109
@property
1110
def files_count(self):
1211
return self._properties.get("FilesCount", None)

office365/sharepoint/authpolicy/events/event.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
class SPAuthEvent(Entity):
5-
65
@property
76
def entity_type_name(self):
87
return "Microsoft.SharePoint.AuthPolicy.Events.SPAuthEvent"

0 commit comments

Comments
 (0)