Skip to content

Commit 35de6c1

Browse files
committed
Initial commit
0 parents  commit 35de6c1

File tree

3,298 files changed

+406351
-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.

3,298 files changed

+406351
-0
lines changed

.github/workflows/cd.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Generate SDK
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 12 * * *"
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
generate-client:
14+
runs-on: ubuntu-latest
15+
name: Generate Python SDK
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Install Poetry
19+
uses: abatilo/actions-poetry@v2
20+
with:
21+
poetry-version: "1.8.3"
22+
23+
- name: Install Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
28+
- name: Install node dependencies
29+
run: npm i
30+
31+
- name: Generate new sdk
32+
run: make generate
33+
34+
- name: Create Pull Request
35+
uses: peter-evans/create-pull-request@v7
36+
with:
37+
branch: update-sdk
38+
delete-branch: true
39+
labels: bot
40+
title: "Update Python SDK"
41+
commit-message: "ci: Update python-sdk"
42+
body: "New [API](https://api.vulncheck.com/v3/openapi) changes have been detected."

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI 🚀
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
lint-and-test:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install flake8 pytest
24+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25+
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
26+
27+
- name: Lint with flake8
28+
run: |
29+
# stop the build if there are Python syntax errors or undefined names
30+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
31+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
32+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
33+
34+
- name: Test with pytest
35+
env:
36+
VULNCHECK_API_TOKEN: ${{ secrets.VULNCHECK_API_TOKEN }}
37+
run: make test

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
name: Build distribution 📦
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install Poetry
16+
uses: abatilo/actions-poetry@v2
17+
with:
18+
poetry-version: "1.8.3"
19+
- name: Build Module
20+
run: make build
21+
- name: Store the distribution packages
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: python-package-distributions
25+
path: dist/
26+
27+
publish-to-testpypi:
28+
name: >-
29+
Publish Python 🐍 distribution 📦 to TestPyPI
30+
needs:
31+
- build
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: testpypi
35+
url: https://test.pypi.org/p/vulncheck-sdk
36+
permissions:
37+
id-token: write
38+
steps:
39+
- name: Download all the dists
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: python-package-distributions
43+
path: dist/
44+
- name: Publish package distributions to PyPI
45+
uses: pypa/gh-action-pypi-publish@release/v1
46+
with:
47+
repository-url: https://test.pypi.org/legacy/
48+
49+
publish-to-pypi:
50+
name: >-
51+
Publish Python 🐍 distribution 📦 to PyPI
52+
needs:
53+
- build
54+
runs-on: ubuntu-latest
55+
environment:
56+
name: pypi
57+
url: https://pypi.org/p/vulncheck-sdk
58+
permissions:
59+
id-token: write
60+
steps:
61+
- name: Download all the dists
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: python-package-distributions
65+
path: dist/
66+
- name: Publish distribution 📦 to PyPI
67+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
node_modules/
2+
openapi.json
3+
4+
# Byte-compiled / optimized / DLL files
5+
__pycache__/
6+
*.py[cod]
7+
*$py.class
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
env/
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
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+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*,cover
49+
.hypothesis/
50+
venv/
51+
.venv/
52+
.python-version
53+
.pytest_cache
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
62+
# Sphinx documentation
63+
docs/_build/
64+
65+
# PyBuilder
66+
target/
67+
68+
#Ipython Notebook
69+
.ipynb_checkpoints

.openapi-generator-ignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
24+
25+
.gitignore
26+
.github/**
27+
.gitlab-ci.yml
28+
.travis.yml
29+
tox.ini
30+
31+
git_push.sh
32+
33+
test/integration_test.py

0 commit comments

Comments
 (0)