Skip to content

Commit ac11148

Browse files
authored
Merge pull request #97 from onelogin/refactor_setup
Modernize Python packaging to use pyproject.toml
2 parents aff1341 + b094b99 commit ac11148

File tree

14 files changed

+60
-200
lines changed

14 files changed

+60
-200
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install .
2423
pip install -e ".[test]"
2524
- name: Test
2625
run: |
27-
python -m unittest
26+
python -m pytest

.github/workflows/python-publish.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ jobs:
3232
python -m pip install --upgrade pip
3333
pip install build
3434
- name: Build package
35-
run: python -m
36-
build
37-
--sdist
38-
--wheel
39-
--outdir dist/
40-
.
35+
run: python -m build --sdist --wheel --outdir dist/ .
4136
- name: Publish distribution 📦 to PyPI
4237
uses: pypa/gh-action-pypi-publish@release/v1
4338
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ target/
6464

6565
#Ipython Notebook
6666
.ipynb_checkpoints
67+
68+
**/.claude/settings.local.json

.gitlab-ci.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,38 @@ Python 3.7+
1717

1818
### pip install
1919

20-
If the python package is hosted on a repository, you can install directly using:
20+
You can install directly using pip:
2121

2222
```sh
2323
pip install onelogin
2424
```
2525

26-
(you may need to run `pip` with root permission: `sudo pip install onelogin`)
26+
For development and testing, install with test dependencies:
27+
28+
```sh
29+
pip install onelogin[test]
30+
```
2731

2832
Then import the package:
2933

3034
```python
3135
import onelogin
3236
```
3337

34-
### Setuptools
38+
### Tests
3539

36-
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
40+
First, install the package with test dependencies:
3741

3842
```sh
39-
python setup.py install --user
43+
pip install -e .[test]
4044
```
4145

42-
(or `sudo python setup.py install` to install the package for all users)
43-
44-
Then import the package:
46+
Then run the tests:
4547

46-
```python
47-
import onelogin
48+
```sh
49+
pytest
4850
```
4951

50-
### Tests
51-
52-
Execute `pytest` to run the tests.
53-
5452
## Getting Started
5553

5654
Please follow the [installation procedure](#installation--usage) and then run the following:

git_push.sh

Lines changed: 0 additions & 57 deletions
This file was deleted.

onelogin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"""
1515

1616

17-
__version__ = "3.1.5"
17+
__version__ = "3.1.6"
1818

1919
# import apis into sdk package
2020
from onelogin.api.api_auth_claims_api import APIAuthClaimsApi

pyproject.toml

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,49 @@
1-
[tool.poetry]
1+
[project]
22
name = "onelogin"
3-
version = "3.1.5"
3+
version = "3.1.6"
44
description = "OneLogin API"
5-
authors = ["OneLogin <team@openapitools.org>"]
6-
license = "NoLicense"
5+
authors = [
6+
{name = "OneLogin", email = "team@openapitools.org"}
7+
]
8+
license = {text = "NoLicense"}
79
readme = "README.md"
8-
repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
910
keywords = ["OpenAPI", "OpenAPI-Generator", "OneLogin API"]
11+
requires-python = ">=3.7"
12+
dependencies = [
13+
"urllib3>=2.0.2",
14+
"python-dateutil>=2.5.3",
15+
"pydantic>=2.11.0",
16+
"aenum>=3.1.11",
17+
"setuptools>=67.7.1",
18+
]
1019

11-
[tool.poetry.dependencies]
12-
python = "^3.7"
20+
[project.optional-dependencies]
21+
test = [
22+
"pytest~=7.1.3",
23+
"pytest-cov>=2.8.1",
24+
"pytest-randomly>=3.12.0",
25+
"flake8>=4.0.0",
26+
"tox>=3.9.0",
27+
]
1328

14-
urllib3 = ">= 1.25.3"
15-
python-dateutil = ">=2.8.2"
16-
pydantic = ">=2.11.0"
17-
aenum = ">=3.1.11"
18-
19-
[tool.poetry.dev-dependencies]
20-
pytest = ">=7.2.1"
21-
tox = ">=3.9.0"
22-
flake8 = ">=4.0.0"
29+
[project.urls]
30+
Repository = "https://github.com/onelogin/onelogin-python-sdk"
2331

2432
[build-system]
25-
requires = ["setuptools"]
33+
requires = ["setuptools>=67.7.1", "wheel"]
2634
build-backend = "setuptools.build_meta"
2735

36+
[tool.setuptools]
37+
packages = ["onelogin"]
38+
package-dir = {"" = "."}
39+
include-package-data = true
40+
41+
[tool.pytest.ini_options]
42+
testpaths = ["test"]
43+
python_files = "test_*.py"
44+
45+
[tool.flake8]
46+
max-line-length = 99
47+
2848
[tool.pylint.'MESSAGES CONTROL']
2949
extension-pkg-whitelist = "pydantic"

requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)