diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index f3c10a261..000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# to disable hooks: SKIP=pylint git commit ... -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 - hooks: - - id: trailing-whitespace - exclude: "snapshots/" - - id: mixed-line-ending - exclude: "snapshots/" - - - repo: https://github.com/psf/black - rev: 20.8b1 - hooks: - - id: black - - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.3 - hooks: - - id: flake8 - - repo: https://github.com/pycqa/pydocstyle - rev: 5.1.1 - hooks: - - id: pydocstyle - files: ^src/xtgeo/plot - exclude: _.*\.py - - repo: https://github.com/pycqa/pylint - rev: pylint-2.6.0 - hooks: - - id: pylint - files: ^src/xtgeo/plot - # - repo: https://github.com/PyCQA/bandit - # rev: 1.7.0 - # hooks: - # - id: bandit - # args: [--skip, "B311", --recursive, --quiet] - # files: src/xtgeo diff --git a/docs/contributing.rst b/docs/contributing.rst index 50deaad96..e728f3335 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -83,9 +83,7 @@ up your fork for local development (first time): $ source bin/activate $ cd /your_path_to_git_clone/xtgeo/ $ pip install pip -U - $ pip install -r requirements/requirements_dev.txt - $ python setup.py clean - $ python setup.py develop + $ pip install ".[dev,docs]" $ pytest # to check that stuff works 4. Create a branch for local development: @@ -100,13 +98,12 @@ Now you can make your changes locally. .. code-block:: bash - $ flake8 - $ pylint - $ Use `pytest` for running tests - $ Run `black` on your python code, then there is no discussions on formatting - -To get ``flake8``, ``pylint`` and ``black`` and just pip install them into -your virtualenv. + $ black src tests + $ flake8 src tests + $ isort src tests + $ mypy src + $ pylint src tests + $ pytest tests 6. If you want to edit C code, take contact with the author for detailed instructions. @@ -137,9 +134,7 @@ and it is targeted to Equinor usage using bash shell in Linux: $ source ~/venv/py36_rms12.0.2/bin/activate $ cd path_to_xtgeo/ $ python -m pip install pip -U - $ pip install requirements/requirements_dev.txt - $ python setup.py clean - $ python setup.py develop + $ pip install ".[dev]" $ pytest Now you have an editable install in your virtual environment that can be ran diff --git a/pyproject.toml b/pyproject.toml index 77dada624..8f5747543 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,6 @@ dependencies = [ "segyio>1.8.0", "shapely>=1.6.2", "tables;platform_system != 'Darwin'", # TODO: update when fixed for mac - "typing-extensions", ] [project.urls] @@ -74,6 +73,7 @@ dev = [ "flake8", "isort", "hypothesis", + "mypy", "pylint", "pytest", "pytest-benchmark", @@ -83,6 +83,7 @@ dev = [ "pytest-mock", "pytest-snapshot", "pytest-xdist", + "typing-extensions", ] docs = [ "pydocstyle", @@ -109,6 +110,7 @@ exclude = ''' | buck-out | build | dist + | _theversion.py # The following are specific to Black, you probably don't want those. | blib2to3 | tests/data @@ -116,6 +118,12 @@ exclude = ''' )/ ''' +[tool.isort] +profile = "black" + +[tool.mypy] +ignore_missing_imports = true + [tool.pydocstyle] convention = "google" match = '(?!(test_|_)).*\.py' diff --git a/scripts/swig_manylinux.sh b/scripts/swig_manylinux.sh deleted file mode 100755 index cdd20ab66..000000000 --- a/scripts/swig_manylinux.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# For manylinux docker installs in CI - -echo "Download swig..." -SWIGURL="https://ftp.osuosl.org/pub/blfs/conglomeration/swig" -SWIG="swig-4.0.1" -curl -O ${SWIGURL}/${SWIG}.tar.gz -tar xzf ${SWIG}.tar.gz -cd $SWIG -echo "Download swig... done" - -echo "Download pcre..." -curl -O "https://ftp.pcre.org/pub/pcre/pcre-8.38.tar.gz" -sh Tools/pcre-build.sh > /dev/null -echo "PCRE is built locally" - -sh ./configure \ - --with-python \ - --with-python3 \ - --without-perl5 \ - --without-ruby \ - --without-tcl \ - --without-maximum-compile-warnings \ - > /dev/null -make > /dev/null -make install > /dev/null -echo "SWIG installed"