Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
push:
branches:
- master
- main
pull_request:

jobs:
test:
if: github.repository == 'netcloud/aciClient'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Sync dependencies
run: uv sync --group dev

- name: Run tests
run: uv run pytest

- name: Run lint
run: uv run ruff check .
53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish

on:
workflow_dispatch:
push:
tags:
- "v*"

jobs:
build:
if: github.repository == 'netcloud/aciClient'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"
enable-cache: true

- name: Build distributions
run: uv build

- name: Store distributions
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-pypi:
if: github.repository == 'netcloud/aciClient'
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write

environment:
name: pypi

steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
36 changes: 0 additions & 36 deletions .github/workflows/python-app.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ Thumbs.db
**/Thumbs.db
**/leaf-*.html
.venv
.venv/
venv
.uv-cache/
build/
dist
dist/
*.egg-info/
.pytest_cache
__pycache__/
.pytest_cache
.pytest_cache/
56 changes: 41 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,57 @@ Please follow the procedure below:
1. Please search existing issues to determine if an issue already exists for what you intend to contribute.
2. If the issue does not already exist, create a new issue and describe the bug or feature request.
3. Please wait for a feedback.
4. With a positive feedback from us You can go on and fork the project for doing Your changes.
5. Following the Pull Request Process
4. With positive feedback from us, fork the repository and prepare your changes there.
5. Open a pull request to `netcloud/aciClient`.

## Pull Request Process

1. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is:

```
<MAJOR>.<MINOR>
```

Major = Breaking Changes

Minor = Backwards Compatible / New Features / Bug Fixes

2. Create Pull Request
1. Install the development environment:

```bash
uv sync --group dev
```

2. Run the local checks before opening or updating a pull request:

```bash
uv run pytest
uv run ruff check .
```

3. Update documentation and examples when your change affects behavior.

4. Open a pull request to `netcloud/aciClient`.

The upstream CI workflow runs on pull requests and validates the change set.

## Release Process

Releases are done from the upstream repository:

1. Contributors work in forks and submit pull requests to `netcloud/aciClient`.
2. The upstream CI workflow runs tests and lint checks for the pull request.
3. After review, the pull request is merged into `netcloud/aciClient`.
4. When maintainers want to publish a release, they update the version in `pyproject.toml` if needed.
5. Maintainers create a version tag such as `v1.8` in `netcloud/aciClient`.
6. The upstream publish workflow builds the package with `uv build` and publishes it to PyPI.

Publishing requires PyPI trusted publishing to be configured for `netcloud/aciClient`.

# Coding Convention

* Python Language Rules (PEP8) are followed and verified with flake8
* Python Language Rules (PEP8) are followed and verified with Ruff
* The code is structured according to the Clean Code paradigm
* Code and Documentation is written in English
* At least UnitTests are written
* A useful exception handling is available
* A useful logging is available
* If foreign code is used, no license agreements have been broken.

## Local Development

```bash
uv sync --group dev
uv run pytest
uv run ruff check .
```
30 changes: 0 additions & 30 deletions Makefile

This file was deleted.

27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@ A python wrapper to the Cisco ACI REST-API.

## Python Version

We support Python 3.6 and up. Python 2 is not supported and there is no plan to add support for it.
We support Python 3.10 and up.

## Installation
``pip install aciClient``
With `pip`:

## Installation for Developing
```bash
pip install aciClient
```
git clone https://github.com/netcloud/aciclient.git
pip install -r requirements.txt
python setup.py develop

With `uv`:

```bash
uv add aciClient
```

## Installation for Developing
```bash
git clone https://github.com/netcloud/aciClient.git
uv sync --group dev
```

## Usage
Expand Down Expand Up @@ -118,12 +127,6 @@ To use the subscriptions you have to:

You can find example code here: examples/subscription.py

## Testing

```
pip install -r requirements.txt
python -m pytest
```
## Contributing

Please read [CONTRIBUTING.md](https://github.com/netcloud/aciClient/blob/master/CONTRIBUTING.md) for details on our code
Expand Down
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[build-system]
requires = ["setuptools>=69"]
build-backend = "setuptools.build_meta"

[project]
name = "aciClient"
version = "1.8"
description = "ACI communication helper class"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [
{ name = "Netcloud AG", email = "nc_dev@netcloud.ch" },
]
dependencies = [
"pyOpenSSL>=26.0.0,<27",
"requests[socks]>=2.33.1,<3",
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]

[project.urls]
Homepage = "https://github.com/netcloud/aciClient"
Repository = "https://github.com/netcloud/aciClient"
Issues = "https://github.com/netcloud/aciClient/issues"

[dependency-groups]
dev = [
"pytest>=9.0.2,<10",
"requests-mock>=1.12.1,<2",
"ruff>=0.13.0,<0.14",
]

[tool.setuptools]
packages = ["aciClient"]

[tool.pytest.ini_options]
testpaths = ["test"]

[tool.ruff]
target-version = "py310"
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

Loading