-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to a pyproject.toml based package
- Loading branch information
Showing
15 changed files
with
175 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
ignore = E402, W503, E203, C901 | ||
exclude = docs/conf.py, version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,44 @@ | ||
# build and test some end points | ||
name: Build and test xtgeoviz | ||
|
||
# on: [push, pull_request] | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: [main] | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
schedule: | ||
# Run nightly to check that tests are working with latest dependencies | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
build_pywheels: | ||
name: PY ${{ matrix.python-version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
test: | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install library | ||
run: > | ||
pip install pip -U && | ||
pip install . | ||
- name: Clone xtgeo-testdata | ||
run: git clone --depth 1 https://github.com/equinor/xtgeo-testdata ../xtgeo-testdata | ||
|
||
- run: git clone --depth 1 https://github.com/equinor/xtgeo-testdata ../xtgeo-testdata | ||
shell: bash | ||
- name: Install | ||
run: | | ||
pip install -U pip | ||
pip install ".[tests]" | ||
- name: Full test | ||
run: > | ||
pip install -r requirements/requirements_test.txt && | ||
pytest --disable-warnings -x | ||
- name: Run tests | ||
run: pytest -n auto --disable-warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,49 @@ | ||
name: linting | ||
name: Linting | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
schedule: | ||
# Run nightly to check that tests are working with latest dependencies | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
linting: | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8"] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v2 | ||
- name: Check black style and linting | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install | ||
run: | | ||
pip install black | ||
black --check *.py src tests | ||
pip install flake8 | ||
flake8 src tests | ||
pip install -U pip | ||
pip install ".[tests]" | ||
- name: Lint with isort | ||
if: ${{ always() }} | ||
run: isort --check-only --profile black src tests | ||
|
||
- name: Lint with black | ||
if: ${{ always() }} | ||
run: black --check src tests | ||
|
||
- name: Lint with flake8 | ||
if: ${{ always() }} | ||
run: flake8 src tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,108 @@ | ||
# NOTE: you have to use single-quoted strings in TOML for regular expressions. | ||
|
||
[build-system] | ||
requires = [ | ||
"pip>=19.1.1", | ||
"setuptools>=45", | ||
"setuptools_scm[toml]>=6.2", | ||
"wheel", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/xtgeoviz/version.py" | ||
|
||
[project] | ||
name = "xtgeoviz" | ||
description = "Plotting library for xtgeo objects" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = { file = "LICENSE" } | ||
authors = [ | ||
{ name = "Equinor", email = "fg_fmu-atlas@equinor.com" }, | ||
] | ||
keywords = [ | ||
"energy", | ||
"subsurface", | ||
"reservoir", | ||
"scientific", | ||
"engineering", | ||
"maps", | ||
"xtgeo", | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
"Topic :: Software Development :: Libraries", | ||
"Topic :: Utilities", | ||
"Operating System :: POSIX :: Linux", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: MacOS", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Natural Language :: English", | ||
"License :: OSI Approved :: GNU Lesser General Public", | ||
"License v3 or later (LGPLv3+)", | ||
] | ||
dynamic = ["version"] | ||
dependencies = [ | ||
"xtgeo>=2.14", | ||
"PyYAML", | ||
"scipy>=1.5.3", | ||
"matplotlib>=3.3.2", | ||
"numpy>=1.19.2", | ||
] | ||
|
||
[project.optional-dependencies] | ||
tests = [ | ||
"black", | ||
"coverage>=4.1", | ||
"flake8", | ||
"isort", | ||
"mypy", | ||
"pylint", | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-runner", | ||
"pytest-mock", | ||
"pytest-xdist", | ||
"rstcheck", | ||
"types-PyYAML", | ||
] | ||
docs = [ | ||
"sphinx", | ||
"autoapi", | ||
"sphinxcontrib-apidoc", | ||
"sphinx-argparse", | ||
"sphinx-autodoc-typehints", | ||
"sphinx-copybutton", | ||
"sphinx-togglebutton", | ||
"sphinx_rtd_theme", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/equinor/xtgeoviz" | ||
Repository = "https://github.com/equinor/xtgeoviz" | ||
Documentation = "https://github.com/equinor/xtgeoviz" | ||
Issues = "https://github.com/equinor/xtgeoviz/issues" | ||
|
||
[tool.black] | ||
line-length = 88 | ||
target-version = ['py36', 'py37', 'py38', 'py39', 'py310'] | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
/( | ||
\.eggs | ||
| \.git | ||
| \.hg | ||
| \.mypy_cache | ||
| \.tox | ||
| \.venv | ||
| _buildsetuptools.scm | ||
| buck-out | ||
| build | ||
| dist | ||
# The following are specific to Black, you probably don't want those. | ||
| blib2to3 | ||
| profiling | ||
)/ | ||
''' | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/xtgeoviz/version.py" | ||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "--verbose" | ||
log_cli = "False" | ||
log_cli_format = "%(levelname)8s (%(relativeCreated)6.0fms) %(filename)44s [%(funcName)40s()] %(lineno)4d >> %(message)s" | ||
log_cli_level = "INFO" | ||
testpaths = "tests" | ||
markers = [ | ||
"integration: Integration tests", | ||
] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.