Skip to content

Commit 35158ce

Browse files
ci: added project configuration
1 parent f4dbd5a commit 35158ce

File tree

7 files changed

+137
-0
lines changed

7 files changed

+137
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish Python Package
2+
on:
3+
release:
4+
types: [published]
5+
permissions:
6+
contents: read
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Python
13+
uses: actions/setup-python@v3
14+
with:
15+
python-version: '3.11'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install build
20+
- name: Build package
21+
run: python -m build
22+
- name: Publish package
23+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
24+
with:
25+
user: __token__
26+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-test.yml

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

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Contributions are welcome, including code, documentation, and examples.
2+
3+
## How to contribute
4+
5+
GitHub issues and PRs are the preferred way to receive contributions.
6+
7+
To make a PR from a separate branch which is rebased to up-to-date master.

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
11
# Jira Service Management Python Bindings
22

3+
Low-level Python bindings for Jira Service Management API.
34

5+
Jira Service Management API documentation can be found at https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/
46

7+
8+
## Installation
9+
10+
Install current release by pip
11+
12+
```
13+
pip install jsm-python-api
14+
```
15+
16+
## Getting Started
17+
18+
You need an API token for communicating with Opsgenie REST APIs.
19+
20+
21+
### Assets API
22+
23+
```
24+
from jiraservicemanagement.api.v1 import Assets
25+
26+
assets = Assets(
27+
workspaceId="...",
28+
auth={
29+
"url": "...",
30+
"username": "...",
31+
"password": "..."
32+
}
33+
)
34+
object_schema = assets.list_object_schema()
35+
print(object_schema)
36+
37+
```
38+
39+
40+
## Contributing
41+
42+
Contribution is welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
atlassian-python-api>=3.41.14

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[metadata]
2+
description-file = README.md
3+
4+
[tool:pytest]
5+
testpaths = tests

setup.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import setuptools
2+
3+
with open("README.md", "r") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="jsm-python-api",
8+
version="0.1",
9+
author="Stanislav Ulrych",
10+
author_email="[email protected]",
11+
description="Python bindings for Jira Service Management API",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://github.com/stanislavulrych/jsm-python-api",
15+
packages=setuptools.find_packages(),
16+
project_urls={
17+
"Bug Tracker": "https://github.com/stanislavulrych/jsm-python-api/issues",
18+
},
19+
classifiers=[
20+
"Programming Language :: Python :: 3",
21+
"License :: OSI Approved :: Apache Software License",
22+
"Operating System :: OS Independent",
23+
],
24+
python_requires='>=3.10.11',
25+
)

0 commit comments

Comments
 (0)