Skip to content

Commit 875504f

Browse files
authored
Create the OpenStack Odoo Client Library for Python (#1)
Create a new OpenStack-centric Odoo client Python library to use in our billing-related OpenStack projects.
1 parent 64d6802 commit 875504f

93 files changed

Lines changed: 18080 additions & 2 deletions

Some content is hidden

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

.github/workflows/main.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
3+
name: main
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
publish-github-pages:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: Clone full tree, and checkout branch
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Setup Python and PDM
19+
uses: pdm-project/setup-pdm@v4
20+
with:
21+
python-version: "3.12"
22+
version: "2.16.1"
23+
- name: Create virtual environment
24+
run: pdm install
25+
- name: Publish the docs to GitHub Pages
26+
run: pdm run mike deploy --push develop

.github/workflows/tag.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: tag
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*.*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- name: Clone full tree, and checkout tag
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Setup Python and PDM
17+
uses: pdm-project/setup-pdm@v4
18+
with:
19+
python-version: "3.12"
20+
version: "2.16.1"
21+
- name: Build source dist and wheels
22+
run: pdm build --verbose
23+
- name: Upload source dist and wheels to artifacts
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: dist
27+
path: dist/
28+
retention-days: 5
29+
if-no-files-found: error
30+
31+
publish-pypi:
32+
needs: build
33+
runs-on: ubuntu-22.04
34+
environment: pypi
35+
permissions:
36+
id-token: write
37+
steps:
38+
- name: Clone full tree, and checkout tag
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
- name: Download source dist and wheels from artifacts
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: dist
46+
path: dist/
47+
- name: Setup Python and PDM
48+
uses: pdm-project/setup-pdm@v4
49+
with:
50+
python-version: "3.12"
51+
version: "2.16.1"
52+
- name: Publish source dist and wheels to PyPI
53+
run: pdm publish --no-build --verbose
54+
55+
publish-github-release:
56+
needs: build
57+
runs-on: ubuntu-22.04
58+
permissions:
59+
contents: write
60+
steps:
61+
- name: Clone and checkout tag
62+
uses: actions/checkout@v4
63+
- name: Download source dist and wheels from artifacts
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: dist
67+
path: dist/
68+
- name: Extract changelog
69+
id: extract-changelog
70+
uses: sean0x42/markdown-extract@v2
71+
with:
72+
file: docs/changelog.md
73+
pattern: ${{ github.ref_name }}
74+
- name: Publish the GitHub Release
75+
uses: softprops/action-gh-release@v2
76+
with:
77+
body: ${{ steps.extract-changelog.outputs.markdown }}
78+
files: dist/*
79+
fail_on_unmatched_files: true
80+
81+
publish-github-pages:
82+
runs-on: ubuntu-22.04
83+
steps:
84+
- name: Clone full tree, and checkout branch
85+
uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 0
88+
- name: Setup Python and PDM
89+
uses: pdm-project/setup-pdm@v4
90+
with:
91+
python-version: "3.12"
92+
version: "2.16.1"
93+
- name: Create virtual environment
94+
run: pdm install
95+
- name: Publish the docs to GitHub Pages
96+
run: pdm run mike deploy --push --update-aliases ${{ github.ref_name }} latest

.github/workflows/test.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Clone and checkout branch
14+
uses: actions/checkout@v4
15+
- name: Setup Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
cache: "pip"
20+
- name: Run pre-commit hooks
21+
uses: pre-commit/action@v3.0.1
22+
23+
build:
24+
needs: pre-commit
25+
runs-on: ubuntu-22.04
26+
steps:
27+
- name: Clone full tree, and checkout branch
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
- name: Setup Python and PDM
32+
uses: pdm-project/setup-pdm@v4
33+
with:
34+
python-version: "3.12"
35+
version: "2.16.1"
36+
- name: Build source dist and wheels
37+
run: pdm build --verbose
38+
- name: Upload source dist and wheels to artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: dist
42+
path: dist/
43+
retention-days: 5
44+
if-no-files-found: error
45+
46+
# test:
47+
# needs: pre-commit
48+
# permissions:
49+
# checks: write
50+
# strategy:
51+
# fail-fast: false
52+
# matrix:
53+
# operating_system:
54+
# - ubuntu-22.04
55+
# - windows-2022
56+
# python_version:
57+
# - "3.8"
58+
# - "3.9"
59+
# - "3.10"
60+
# - "3.11"
61+
# - "3.12"
62+
# runs-on: ${{ matrix.operating_system }}
63+
# steps:
64+
# - name: Clone full tree, and checkout branch
65+
# uses: actions/checkout@v4
66+
# with:
67+
# fetch-depth: 0
68+
# - name: Setup Python and PDM
69+
# uses: pdm-project/setup-pdm@v4
70+
# with:
71+
# python-version: ${{ matrix.python_version }}
72+
# version: "2.16.1"
73+
# - name: Create virtual environment
74+
# run: pdm install
75+
# - name: Run tests
76+
# run: pdm run test
77+
# - name: Publish test results
78+
# uses: mikepenz/action-junit-report@v4
79+
# # Always run, even if the tests fail.
80+
# if: success() || failure()
81+
# with:
82+
# report_paths: rspec.xml
83+
# - name: Upload coverage report to artifacts
84+
# uses: actions/upload-artifact@v4
85+
# # Always run, even if the tests fail.
86+
# if: success() || failure()
87+
# with:
88+
# name: coverage-${{ matrix.operating_system}}-${{ matrix.python_version }}
89+
# path: coverage.xml
90+
# retention-days: 5
91+
# if-no-files-found: warn
92+
93+
# coverage:
94+
# needs: test
95+
# # Always run, even if the test job failed.
96+
# if: success() || failure()
97+
# runs-on: ubuntu-22.04
98+
# steps:
99+
# - name: Download coverage reports from artifacts
100+
# uses: actions/download-artifact@v4
101+
# with:
102+
# pattern: coverage-*
103+
# merge-multiple: false
104+
# - name: Generate code coverage summary report
105+
# uses: irongut/CodeCoverageSummary@v1.3.0
106+
# with:
107+
# filename: coverage-*/coverage.xml
108+
# format: markdown
109+
# hide_branch_rate: false
110+
# hide_complexity: false
111+
# indicators: false
112+
# output: both
113+
# - name: Write to job summary
114+
# run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,6 @@ cython_debug/
160160
# and can be added to the global gitignore or merged into this file. For a more nuclear
161161
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162162
#.idea/
163+
164+
# VS Code
165+
.vscode

.pre-commit-config.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
# .pre-commit-config.yml
3+
# Pre-commit hook tasks.
4+
# See https://pre-commit.com for more information
5+
# See https://pre-commit.com/hooks.html for more hooks
6+
7+
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: "v4.5.0"
10+
hooks:
11+
- id: trailing-whitespace
12+
- id: mixed-line-ending
13+
- id: end-of-file-fixer
14+
- id: detect-private-key
15+
- id: check-added-large-files
16+
- id: check-merge-conflict
17+
- repo: https://github.com/crate-ci/typos
18+
rev: "v1.22.9"
19+
hooks:
20+
- id: typos
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
rev: "v0.4.8"
23+
hooks:
24+
- id: ruff
25+
- id: ruff-format
26+
- repo: https://github.com/pre-commit/mirrors-mypy
27+
rev: "v1.10.0"
28+
hooks:
29+
- id: mypy
30+
additional_dependencies:
31+
- OdooRPC>=0.9.0
32+
- packaging
33+
- typing-extensions>=4.0.0
34+
- repo: https://github.com/pdm-project/pdm
35+
rev: "2.16.1"
36+
hooks:
37+
- id: pdm-lock-check

0 commit comments

Comments
 (0)