Skip to content

Commit

Permalink
Convert to pure pyproject.toml setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrivenaes committed Oct 25, 2023
1 parent 4887ca8 commit 6571d3c
Show file tree
Hide file tree
Showing 18 changed files with 155 additions and 308 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 88
ignore = W503, E203
exclude = docs/conf.py, .eggs, version.py
3 changes: 1 addition & 2 deletions .github/workflows/ci-fmudataio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
- name: Install fmu-dataio
run: >
pip install pip -U &&
pip install .
pip install .[dev]
- name: Full test
run: >
pip install -r requirements/requirements_test.txt &&
pytest --disable-warnings -x
6 changes: 3 additions & 3 deletions .github/workflows/fmudataio-publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install --upgrade setuptools wheel twine
- name: Install pypa/build
run: python -m pip install build twine
- name: Build package
run: python setup.py sdist bdist_wheel
run: python -m build . --sdist --wheel --outdir dist/
- name: Upload deploy
env:
TWINE_USERNAME: __token__
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: Check black style and linting
run: |
pip install black
black --check *.py src tests
black --check src tests
pip install flake8
flake8 src tests
pip install isort
isort --profile=black *.py src tests
isort --profile=black src tests
44 changes: 0 additions & 44 deletions .pylintrc

This file was deleted.

1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ build:

python:
install:
- requirements: requirements/requirements.txt
- method: pip
path: .[docs]

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ pip install -e .
```
Install requirements for running tests:
```console
pip install -e .[tests,docs]
pip install -e .[dev,docs]
```
Then run the command:
Then run the command:
```console
pytest
```

145 changes: 143 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,82 @@
# NOTE: you have to use single-quoted strings in TOML for regular expressions.
[build-system]
requires = ["pip>=19.1.1", "setuptools", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "fmu-dataio"
description = "Facilitate data io in FMU with rich metadata"
readme = "README.md"
requires-python = ">=3.8"
license = { text = "Apache 2.0" }
authors = [{ name = "Equinor", email = "[email protected]" }]
keywords = ["fmu", "sumo"]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
]
dynamic = ["version"]
dependencies = [
"xtgeo>=2.16",
"PyYAML",
"pyarrow",
"fmu-config>=1.1.0",
"pandas",
"numpy",
]

[project.urls]
Homepage = "https://github.com/equinor/fmu-dataio"
Repository = "https://github.com/equinor/fmu-dataio"
Issues = "https://github.com/equinor/fmu-dataio/issues"
Documentation = "https://fmu-dataio.readthedocs.io"

[project.optional-dependencies]
dev = [
"black",
"coverage>=4.1",
"flake8",
"isort",
"jsonschema",
"hypothesis",
"mypy",
"pylint",
"pytest",
"pytest-cov",
"pydocstyle",
"pytest-runner",
"pytest-mock",
"termcolor",
"rstcheck",
]
docs = [
"pydocstyle",
"Sphinx<7",
"autoapi",
"sphinx-rtd-theme",
"sphinx-autodoc-typehints<1.23",
"sphinxcontrib-apidoc",
"sphinx-togglebutton",
"urllib3<1.27",
]

[project.entry-points.ert]
dataio_case_metadata = "fmu.dataio.scripts.create_case_metadata"


[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311']
Expand All @@ -25,5 +103,68 @@ exclude = '''
[tool.isort]
profile = "black"

[build-system]
requires = ["pip>=19.1.1", "setuptools>=28", "setuptools_scm>=3.2.0", "pyarrow"]

[tool.setuptools_scm]
write_to = "src/fmu/dataio/version.py"

[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: marks a test as an integration test"]
xfail_strict = true

[tool.mypy]
ignore_missing_imports = true

[tool.pydocstyle]
convention = "google"
match = '(?!(test_|_)).*\.py'

[tool.pylint.MASTER]
ignore = ["version.py", "conf.py"]

[tool.pylint.BASIC]
additional-builtins = ["_x", "_y", "_z", "_tmp1", "_tmp2"]
good-names = ["logger", "version", "i", "j", "k", "x", "y", "z", "_"]
variable-rgx = "^[a-z_][_a-z0-9]+((_[a-z0-9]+)*)?$"
argument-rgx = "^[a-z_][_a-z0-9]+((_[a-z0-9]+)*)?$"
dummy-variables-rgx = "^_+[a-z0-9]*?$|dummy"

[tool.pylint.TYPECHECK]
generated-members = ["np.*", "numpy.*", "pd.*", "pandas.*"]

[tool.pylint.FORMAT]
max-line-length = 88
max-module-lines = 3000

[tool.pylint.DESIGN]
max-attributes = 30
max-args = 20
max-locals = 30
max-branches = 15
max-bool-expr = 8

[tool.pylint.SIMILARITIES]
min-similarity-lines = 40
ignore-comments = "yes"
ignore-docstrings = "no"
ignore-imports = "yes"

[tool.pylint."MESSAGES CONTROL"]
disable = """
fixme,
missing-docstring,
protected-access,
C0330,
useless-object-inheritance,
import-outside-toplevel,
import-error,
no-name-in-module,
raise-missing-from,
unspecified-encoding,
wrong-import-order
"""
10 changes: 0 additions & 10 deletions pytest.ini

This file was deleted.

6 changes: 0 additions & 6 deletions requirements/requirements.txt

This file was deleted.

7 changes: 0 additions & 7 deletions requirements/requirements_docs.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements/requirements_setup.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements/requirements_test.txt

This file was deleted.

7 changes: 0 additions & 7 deletions requirements/requirements_testx.txt

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/README.txt

This file was deleted.

Loading

0 comments on commit 6571d3c

Please sign in to comment.