Skip to content

Commit 2db48c5

Browse files
authored
Configure pyproject.toml (#180)
* move setup.py config to pyproject.toml * delete requirements files, moved to pyproject.toml * remove old text from README * install test dependencies using pyproject.toml
1 parent 2668247 commit 2db48c5

9 files changed

Lines changed: 54 additions & 106 deletions

File tree

.github/workflows/pytest.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and test Sumo wrapper
22

33
on:
44
pull_request:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
schedule:
77
- cron: "3 3 * * *"
88

@@ -22,30 +22,29 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v3
25-
25+
2626
- name: Azure Login
2727
uses: Azure/login@v1
2828
with:
2929
client-id: f96c150d-cacf-4257-9cc9-54b2c68ec4ce
3030
tenant-id: 3aa4a235-b6e2-48d5-9195-7fcf05b459b0
3131
subscription-id: 87897772-fb27-495f-ae40-486a2df57baa
32-
32+
3333
- name: Set up Python
3434
uses: actions/setup-python@v3
3535
with:
3636
python-version: ${{ matrix.python-version }}
37-
37+
3838
- name: Install sumo-wrapper-python
3939
run: |
4040
python -m pip install --upgrade pip &&
41-
python -m pip install .
41+
python -m pip install .[test]
4242
4343
python -m pip list
44-
44+
4545
- name: Run pytest
4646
shell: bash
4747
run: |
4848
access_token=$(az account get-access-token --scope api://88d2b022-3539-4dda-9e66-853801334a86/.default --query accessToken --output tsv)
4949
export ACCESS_TOKEN=$access_token
50-
pip install -r requirements/requirements_test.txt
51-
pytest -s
50+
pytest -s

.readthedocs.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
# .readthedocs.yaml
2-
# Read the Docs configuration file
3-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
1+
version: 2
42

5-
# Required
63
build:
7-
image: latest
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.10"
87

98
python:
10-
version: "3.8"
11-
install:
12-
- requirements: requirements_docs.txt
13-
- method: setuptools
14-
path: .
15-
system_packages: true
9+
install:
10+
- method: pip
11+
path: .
12+
extra_requirements:
13+
- docs
1614

17-
# Build documentation in the docs/ directory with Sphinx
1815
sphinx:
19-
configuration: docs/conf.py
16+
configuration: docs/conf.py

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Want to contribute? Read our [contributing](./CONTRIBUTING.md) guidelines
1111
For internal Equinor users, this package is available through the Komodo
1212
distribution.
1313

14-
> **:warning:** `CallSumoApi` is deprecated.
15-
1614
# Table of contents
1715

1816
- [sumo-wrapper-python](#sumo-wrapper-python)

pyproject.toml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,41 @@
11
[build-system]
2-
requires = [
3-
"pip>=19.1.1",
4-
"setuptools>=28",
5-
"setuptools_scm>=3.2.0",
6-
"wheel"
7-
]
2+
requires = ["setuptools>=28", "setuptools_scm>=3.2.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
84

95
[tool.setuptools_scm]
10-
write_to = "src/sumo/wrapper/version.py"
6+
version_file = "src/sumo/wrapper/_version.py"
7+
118

129
[tool.black]
13-
line-length = 79
10+
line-length = 79
11+
12+
[project]
13+
name = "sumo-wrapper-python"
14+
description = "Python wrapper for the Sumo API"
15+
license = { file = "LICENSE" }
16+
readme = { file = "README.md", content-type = "text/markdown" }
17+
classifiers = ["Programming Language :: Python"]
18+
authors = [{ name = "Equinor" }]
19+
requires-python = ">=3.8"
20+
dynamic = ["version"]
21+
dependencies = [
22+
"msal>=1.20.0",
23+
"msal-extensions>=1.0.0",
24+
"pyjwt>=2.4.0",
25+
"httpx>=0.24.1",
26+
"tenacity>=8.2.2",
27+
"azure-identity>=1.13.0",
28+
]
29+
30+
[project.optional-dependencies]
31+
test = ["pytest", "PyYAML"]
32+
docs = ["sphinx", "sphinx-rtd-theme"]
33+
34+
[project.urls]
35+
Repository = "https://github.com/equinor/sumo-wrapper-python"
36+
37+
[project.scripts]
38+
sumo_login = "sumo.wrapper.login:main"
39+
40+
[tool.setuptools.packages.find]
41+
where = ["src"]

requirements/requirements.txt

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

requirements/requirements_docs.txt

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

requirements/requirements_test.txt

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

setup.py

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

src/sumo/wrapper/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from ._retry_strategy import RetryStrategy
33

44
try:
5-
from .version import version
5+
from ._version import version
66

77
__version__ = version
88
except ImportError:

0 commit comments

Comments
 (0)