Skip to content

Commit 7c71265

Browse files
llucaxdavid-natingga-frequenzDavid Natinggaela-kotulska-frequenzgigileungyingchi
committed
Import internal release v0.10.0
Co-authored-by: David Natingga <[email protected]> Co-authored-by: David Natingga <[email protected]> Co-authored-by: Ela Kotulska <[email protected]> Co-authored-by: Gigi Leung <[email protected]> Co-authored-by: Idlir Shkurti <[email protected]> Co-authored-by: Jakub Kozlowicz <[email protected]> Co-authored-by: Joseph Rushton Wakeling <[email protected]> Co-authored-by: Matthias Wende <[email protected]> Co-authored-by: Sahas Subramanian <[email protected]> Co-authored-by: Tiyash Basu <[email protected]> Co-authored-by: uditjuneja <[email protected]> Co-authored-by: Vlad Emelianov <[email protected]> Co-authored-by: Vlad Emelianov <[email protected]> Signed-off-by: Leandro Lucarella <[email protected]>
0 parents  commit 7c71265

File tree

96 files changed

+18131
-0
lines changed

Some content is hidden

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

96 files changed

+18131
-0
lines changed

.darglint

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- mode: ini -*-
2+
3+
[darglint]
4+
docstring_style=google
5+
6+
# DAR402: The docstring describes an exception not explicitly raised.
7+
#
8+
# Ignoring DAR402 because there are cases where public methods
9+
# document exceptions raised by underlying functions.
10+
ignore=DAR402

.github/workflows/ci.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: frequenz-sdk-python
2+
3+
on:
4+
push:
5+
branches: [ v0.x.x ]
6+
7+
pull_request:
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
12+
jobs:
13+
test:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python: [ "3.8", "3.9", "3.10" ]
18+
os: [ ubuntu-20.04 ]
19+
20+
runs-on: ${{ matrix.os }}
21+
22+
steps:
23+
- name: Fetch sources
24+
uses: actions/checkout@v2
25+
with:
26+
token: ${{ secrets.CI_ACCESS_TOKEN || github.token }}
27+
submodules: true
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: ${{ matrix.python }}
33+
34+
- uses: actions/cache@v2
35+
with:
36+
path: ~/.cache/pip
37+
key: ${{ runner.os }}-pip-${{ hashFiles('**/minimum-requirements-ci.txt') }}
38+
restore-keys: |
39+
${{ runner.os }}-pip-
40+
41+
- name: Install required Python packages
42+
run: |
43+
python -m pip install --upgrade pip
44+
python -m pip install nox wheel
45+
46+
- name: run nox
47+
run: nox -e ci_checks_max pytest_min
48+
timeout-minutes: 10
49+
50+
build-wheels:
51+
runs-on: ubuntu-20.04
52+
needs: test
53+
54+
steps:
55+
- name: Fetch sources
56+
uses: actions/checkout@v2
57+
with:
58+
token: ${{ secrets.CI_ACCESS_TOKEN || github.token }}
59+
submodules: true
60+
61+
- name: Set up Python
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: 3.8
65+
66+
- uses: actions/cache@v2
67+
with:
68+
path: ~/.cache/pip
69+
key: ${{ runner.os }}-pip-${{ hashFiles('**/minimum-requirements-ci.txt') }}
70+
restore-keys: |
71+
${{ runner.os }}-pip-
72+
73+
- name: Install required Python packages
74+
run: |
75+
python -m pip install --upgrade pip
76+
python -m pip install wheel
77+
78+
- name: make wheel
79+
run: python -m pip wheel --no-deps -w dist .
80+
81+
- name: upload wheels
82+
uses: actions/upload-artifact@v2
83+
with:
84+
name: frequenz-sdk-python-wheels
85+
path: dist/*.whl

.gitignore

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
.vscode
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
# For a library or package, you might want to ignore these files since the code is
88+
# intended to run in multiple environments; otherwise, check them in:
89+
# .python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
99+
__pypackages__/
100+
101+
# Celery stuff
102+
celerybeat-schedule
103+
celerybeat.pid
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Environments
109+
.env
110+
.venv
111+
env/
112+
venv/
113+
ENV/
114+
env.bak/
115+
venv.bak/
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# Rope project settings
122+
.ropeproject
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/
134+
135+
# pytype static type analyzer
136+
.pytype/
137+
138+
# Cython debug symbols
139+
cython_debug/
140+
141+
# PyCharm
142+
.idea

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Frequenz Energy-as-a-Service GmbH
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Frequenz Python SDK
2+
3+
A development kit to interact with the Frequenz development platform.
4+
5+
## Testing locally
6+
7+
### Prerequisites
8+
9+
#### Python version
10+
11+
* For x86_64 Python 3.8 - 3.10 are supported (tested).
12+
* For arm64 only Python 3.8 is supported (due to some dependencies that only support 3.8).
13+
14+
#### Development setup
15+
16+
You need to install the following development dependencies to be able to get
17+
and build all dependencies:
18+
19+
```sh
20+
python -m pip install grpcio-tools mypy-protobuf nox wheel
21+
```
22+
23+
### Running the whole test suite
24+
25+
Run the following command to run tests:
26+
27+
```sh
28+
nox
29+
```
30+
31+
You can also use `nox -R` to reuse the current testing environment to speed up
32+
test at the expense of a higher chance to end up with a dirty test environment.
33+
34+
### Running tests individually
35+
36+
For a better development test cycle you can install the runtime and test
37+
dependencies and run `pytest` manually.
38+
39+
```sh
40+
python -m pip install .
41+
python -m pip install pytest pytest-asyncio
42+
43+
# And for example
44+
pytest tests/test_sdk.py
45+
```

0 commit comments

Comments
 (0)