Skip to content

Commit

Permalink
Merge pull request #1 from cisco-en-programmability/migration-to-en-p…
Browse files Browse the repository at this point in the history
…rogrammability

en-programmability migration
  • Loading branch information
sashiv20 authored Nov 18, 2024
2 parents 91e941f + 546e92e commit 55c42c3
Show file tree
Hide file tree
Showing 14 changed files with 1,277 additions and 1,224 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ default_stages: [commit]
repos:

# Autoformatting (modifies staged files)
- repo: local
hooks:
- id: copyright
name: copyright
entry: python copyright.py
language: system
types: [python]

- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
We're really glad you want to help.

## Here are some important resources:
* Want to add something from yourself? [Make a PR](https://github.com/cisco-open/cisco-catalyst-wan-sdk/pulls) - remember to follow [code guidelines](#code-guidelines).
* Want to add something from yourself? [Make a PR](https://github.com/cisco-en-programmability/catalystwan-sdk/pulls) - remember to follow [code guidelines](#code-guidelines).
### Contributors from CiscoDevNet organization:
To make a PR - pull the repository, create branch for your changes, make said changes and make the pull request. Now just wait for the review and feedback from our developers.
### Contributors outside CiscoDevNet organization
To make a PR - fork our repository, make your changes and make the pull request. Now just wait for the review and feedback from our developers.
* Feel free to review existing [PR](https://github.com/cisco-open/cisco-catalyst-wan-sdk/pulls)s, any suggestion is welcome.
* Want to help but you don't have any new ideas for improvement or feature? Take any [issue](https://github.com/cisco-open/cisco-catalyst-wan-sdk/issues) and fix it.
* Bugs? [Report it here](https://github.com/cisco-open/cisco-catalyst-wan-sdk/issues/new?assignees=&labels=needs+review&template=bug_report.yml) - remember to provide as much information as you can.
* Need some additional feature? [Let us know here](https://github.com/cisco-open/cisco-catalyst-wan-sdk/issues/new?assignees=&labels=enhancement&template=feature_request.yml)
* Feel free to review existing [PR](https://github.com/cisco-en-programmability/catalystwan-sdk/pulls)s, any suggestion is welcome.
* Want to help but you don't have any new ideas for improvement or feature? Take any [issue](https://github.com/cisco-en-programmability/catalystwan-sdk/issues) and fix it.
* Bugs? [Report it here](https://github.com/cisco-en-programmability/catalystwan-sdk/issues/new?assignees=&labels=needs+review&template=bug_report.yml) - remember to provide as much information as you can.
* Need some additional feature? [Let us know here](https://github.com/cisco-en-programmability/catalystwan-sdk/issues/new?assignees=&labels=enhancement&template=feature_request.yml)

## Testing

Expand All @@ -37,7 +37,7 @@ Always write a clear log message for your commits.
1. Download Python3.8 or higher.
2. Download repository
```
git clone https://github.com/cisco-open/cisco-catalyst-wan-sdk.git
git clone https://github.com/cisco-en-programmability/catalystwan-sdk.git
```
3. Install and configure poetry (v1.3.1 or higher)
https://python-poetry.org/docs/#installation
Expand Down
1,212 changes: 606 additions & 606 deletions ENDPOINTS.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@ except ManagerHTTPError as error:

```

## [Supported API endpoints](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/ENDPOINTS.md)
## [Supported API endpoints](https://github.com/cisco-en-programmability/catalystwan-sdk/blob/main/ENDPOINTS.md)


## [Contributing, bug reporting and feature requests](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/CONTRIBUTING.md)
## [Contributing, bug reporting and feature requests](https://github.com/cisco-en-programmability/catalystwan-sdk/blob/main/CONTRIBUTING.md)

## Seeking support

You can contact us by submitting [issues](https://github.com/cisco-open/cisco-catalyst-wan-sdk/issues), or directly via mail on [email protected].
You can contact us by submitting [issues](https://github.com/cisco-en-programmability/catalystwan-sdk/issues), or directly via mail on [email protected].
1,208 changes: 604 additions & 604 deletions catalystwan/ENDPOINTS.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions catalystwan/apigw_auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2024 Cisco Systems, Inc. and its affiliates
import logging
from threading import RLock
from typing import Literal, Optional
Expand Down
1 change: 1 addition & 0 deletions catalystwan/endpoints/api_gateway.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2024 Cisco Systems, Inc. and its affiliates
from pydantic import BaseModel

from catalystwan.endpoints import APIEndpoints, post
Expand Down
2 changes: 1 addition & 1 deletion catalystwan/models/configuration/feature_profile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This README document provides guidelines on creating configuration groups within

Cellular controller Parcel will be used for example purposes. Please change the parcel according to which one you are implementing.

1. Add new endpoints following the guide: https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/CONTRIBUTING.md
1. Add new endpoints following the guide: https://github.com/cisco-en-programmability/catalystwan-sdk/blob/main/CONTRIBUTING.md
2. Download a schema with new endpoint:
```python
@versions(supported_versions=(">=20.9"), raises=False)
Expand Down
1 change: 1 addition & 0 deletions catalystwan/request_limiter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2024 Cisco Systems, Inc. and its affiliates
from __future__ import annotations

from contextlib import AbstractContextManager
Expand Down
1 change: 1 addition & 0 deletions catalystwan/tests/templates/test_find_template_values.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2024 Cisco Systems, Inc. and its affiliates
from catalystwan.api.templates.device_variable import DeviceVariable
from catalystwan.utils.feature_template.find_template_values import find_template_values

Expand Down
1 change: 1 addition & 0 deletions catalystwan/tests/test_url_monitoring.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2024 Cisco Systems, Inc. and its affiliates
import unittest
from unittest.mock import MagicMock, patch

Expand Down
41 changes: 41 additions & 0 deletions copyright.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2024 Cisco Systems, Inc. and its affiliates

import re
from datetime import datetime
from pathlib import Path

COPYRIGHT_NOTICE = f"# Copyright {datetime.now().year} Cisco Systems, Inc. and its affiliates"
COPYRIGHT_PATTERN = r"^#.*copyright.*cisco.*$"
SUBDIRS = ["catalystwan", "examples"]


def check_if_copyright_present(file_path):
try:
with file_path.open("r", encoding="utf-8") as file:
first_line = file.readline().strip()
if re.search(COPYRIGHT_PATTERN, first_line, re.IGNORECASE):
return True
except Exception as e:
print(f"Error reading {file_path}: {e}")
return False


def scan_and_update(dir_path):
directory = Path(dir_path)
if not directory.is_dir():
print(f"The provided path '{dir_path}' is not a valid directory.")
return

for file_path in directory.rglob("*.py"):
if file_path.stat().st_size == 0:
continue
if not check_if_copyright_present(file_path):
with open(file_path, "r+") as file:
content = file.read()
file.seek(0)
file.write(COPYRIGHT_NOTICE + "\n" + content)


if __name__ == "__main__":
for dir in SUBDIRS:
scan_and_update(dir)
4 changes: 2 additions & 2 deletions endpoints-md.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from catalystwan.endpoints import BASE_PATH, APIEndpointRequestMeta, TypeSpecifier, request, versions, view
from catalystwan.utils.session_type import SessionType # type: ignore

SOURCE_BASE_PATH = "https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/"
SOURCE_BASE_PATH = "https://github.com/cisco-en-programmability/catalystwan-sdk/blob/main/"


def relative(absolute: str) -> str:
Expand Down Expand Up @@ -153,7 +153,7 @@ def from_meta(
)

def __lt__(self, other: Endpoint):
self.method_link < other.method_link
return self.method_link < other.method_link

def md(self) -> str:
return "|".join(
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tool.poetry]
name = "catalystwan"
version = "0.36.1"
version = "0.40.0"
description = "Cisco Catalyst WAN SDK for Python"
authors = ["kagorski <[email protected]>"]
readme = "README.md"
repository = "https://github.com/cisco-open/cisco-catalyst-wan-sdk"
repository = "https://github.com/cisco-en-programmability/catalystwan-sdk"

[tool.poetry.dependencies]
python = "^3.8.0"
Expand Down

0 comments on commit 55c42c3

Please sign in to comment.