summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshley Sommer <Ashley.Sommer@csiro.au>2021-07-09 09:52:29 +1000
committerAshley Sommer <Ashley.Sommer@csiro.au>2021-07-09 09:52:29 +1000
commite8d8a083e77e7a7bb17b52c8847e0dbdd3f558ba (patch)
tree1b53ae4ce3876628a0a7df1570303c9a92c54179
parent25d265e8cc6cf86c310493a064927502be9233d7 (diff)
parent4ed7145a440d9721acfb1e15e0971ed81f048a26 (diff)
downloadrdflib-e8d8a083e77e7a7bb17b52c8847e0dbdd3f558ba.tar.gz
Merge remote-tracking branch 'origin/master' into json_ld_11
-rw-r--r--.drone.yml44
-rw-r--r--.editorconfig31
-rw-r--r--Makefile8
-rw-r--r--README.md3
-rw-r--r--black.toml31
-rw-r--r--docs/developers.rst8
-rw-r--r--requirements.dev.txt3
-rw-r--r--setup.py12
8 files changed, 108 insertions, 32 deletions
diff --git a/.drone.yml b/.drone.yml
index d6d839db..55d1c81e 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -1,27 +1,5 @@
---
kind: pipeline
-name: python-3-6
-type: docker
-platform:
- os: linux
- arch: amd64
-
-steps:
-- name: test
- image: python:3.6
- commands:
- - pip install -U setuptools pip
- - bash .travis.fuseki_install_optional.sh
- - pip install --default-timeout 60 -r requirements.txt
- - pip install --default-timeout 60 -r requirements.dev.txt
- - pip install --default-timeout 60 coveralls && export HAS_COVERALLS=1
- - python setup.py install
- - flake8 --exit-zero rdflib
- - PYTHONWARNINGS=default nosetests --with-timer --timer-top-n 42
-
-
----
-kind: pipeline
name: python-3-7
type: docker
platform:
@@ -48,6 +26,7 @@ steps:
- pip install --default-timeout 60 -r requirements.dev.txt
- pip install --default-timeout 60 coveralls && export HAS_COVERALLS=1
- python setup.py install
+ - black --config black.toml --check ./rdflib | true
- flake8 --exit-zero rdflib
- PYTHONWARNINGS=default nosetests --with-timer --timer-top-n 42 --with-coverage --cover-tests --cover-package=rdflib
- coverage report --skip-covered
@@ -68,8 +47,27 @@ steps:
- bash .travis.fuseki_install_optional.sh
- pip install --default-timeout 60 -r requirements.txt
- pip install --default-timeout 60 -r requirements.dev.txt
- - pip install --default-timeout 60 coveralls && export HAS_COVERALLS=1
- python setup.py install
+ - black --config black.toml --check ./rdflib | true
- flake8 --exit-zero rdflib
- PYTHONWARNINGS=default nosetests --with-timer --timer-top-n 42
+---
+kind: pipeline
+name: python-3-9
+type: docker
+platform:
+ os: linux
+ arch: amd64
+
+steps:
+- name: test
+ image: python:3.9
+ commands:
+ - bash .travis.fuseki_install_optional.sh
+ - pip install --default-timeout 60 -r requirements.txt
+ - pip install --default-timeout 60 -r requirements.dev.txt
+ - python setup.py install
+ - black --config black.toml --check ./rdflib | true
+ - flake8 --exit-zero rdflib
+ - PYTHONWARNINGS=default nosetests --with-timer --timer-top-n 42
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..774bb979
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,31 @@
+# EditorConfig is awesome:
+# http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+[*]
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+# Leave line endings as-is in Markdown and ReStructuredText files
+[*.{md, rst}]
+charset = utf-8
+trim_trailing_whitespace = false
+
+# Matches multiple files with brace expansion notation
+# Set default charset
+[*.{js, py, pyi, toml, yml, yaml}]
+charset = utf-8
+
+# 4 space indentation
+[*.py]
+indent_style = space
+indent_size = 4
+max_line_length = 88
+
+# tab indentation
+[Makefile]
+indent_style = tab
diff --git a/Makefile b/Makefile
index 7c484cfc..171f76cf 100644
--- a/Makefile
+++ b/Makefile
@@ -7,4 +7,10 @@ build:
coverage:
docker-compose -f docker-compose.tests.yml up test-runner-coverage
- docker-compose -f docker-compose.tests.yml down \ No newline at end of file
+ docker-compose -f docker-compose.tests.yml down
+
+reformat:
+ black --config ./black.toml .
+
+check-format:
+ black --config ./black.toml --check .
diff --git a/README.md b/README.md
index 87a9f5a7..cc200b6e 100644
--- a/README.md
+++ b/README.md
@@ -210,6 +210,9 @@ Tip: If the underlying Dockerfile for the test runner changes, use `make build`.
### Running the tests in a Docker container with coverage report
Run the test suite inside a Docker container with HTML coverage report.
+```shell
+make coverage
+```
### Viewing test coverage
diff --git a/black.toml b/black.toml
new file mode 100644
index 00000000..abdef9fa
--- /dev/null
+++ b/black.toml
@@ -0,0 +1,31 @@
+[tool.black]
+required-version = "21.6b0"
+line-length = "88"
+skip-string-normalization = true
+target-version = ['py37']
+include = '\.pyi?$'
+exclude = '''
+(
+ /(
+ \.eggs # exclude a few common directories in the
+ | \.git # root of the project
+ | \.hg
+ | \.mypy_cache
+ | \.pytest_cache
+ | \.tox
+ | \.venv
+ | \.github
+ | _build
+ | htmlcov
+ | benchmarks
+ | examples # No need to Black examples
+ | test # Tests are a mess, don't black them
+ | test_reports
+ | rdflib.egg-info
+ | buck-out
+ | build
+ | dist
+ | venv
+ )/
+)
+'''
diff --git a/docs/developers.rst b/docs/developers.rst
index b8c8310c..56d6761b 100644
--- a/docs/developers.rst
+++ b/docs/developers.rst
@@ -12,7 +12,8 @@ developing RDFLib code.
Please be as Pythonic as possible (:pep:`8`).
Code should be formatted using `black <https://github.com/psf/black>`_.
-While not yet mandatory, it will be required in the future (6.0.0+).
+While not yet mandatory, it will be required in the future (6.0.0+).1
+Use Black v21.6b1, with the black.toml config file provided.
Any new functionality being added to RDFLib should have doc tests and
unit tests. Tests should be added for any functionality being changed
@@ -22,6 +23,7 @@ did not break anything.
If you add a new cool feature, consider also adding an example in ``./examples``
+
Running tests
-------------
Run tests with `nose <https://nose.readthedocs.org/en/latest/>`_:
@@ -61,9 +63,9 @@ flag them as expecting to fail.
Compatibility
-------------
-RDFLib 5.x.y tries to be compatible with python versions 2.7, 3.4, 3.5, 3.6, 3.7.
+RDFLib 5.0.0 maintained compatibility with python versions 2.7, 3.4, 3.5, 3.6, 3.7.
-The current master branch (which will be released as 6.0.0) will only support Python 3.6 and newer.
+The latest 6.0.0 release and subsequent will only support Python 3.7 and newer.
Releasing
diff --git a/requirements.dev.txt b/requirements.dev.txt
index 09500eb1..e0b9cf7a 100644
--- a/requirements.dev.txt
+++ b/requirements.dev.txt
@@ -5,4 +5,5 @@ nose-timer
coverage
flake8
doctest-ignore-unicode==0.1.2
-berkeleydb \ No newline at end of file
+berkeleydb
+black==21.6b0
diff --git a/setup.py b/setup.py
index c5c1405a..9a23410a 100644
--- a/setup.py
+++ b/setup.py
@@ -9,8 +9,12 @@ kwargs["install_requires"] = ["isodate", "pyparsing", "setuptools"]
kwargs["tests_require"] = [
"html5lib",
"networkx",
- "nose",
- "doctest-ignore-unicode",
+ "nose==1.3.7",
+ "nose-timer",
+ "coverage",
+ "black==21.6b0",
+ "flake8",
+ "doctest-ignore-unicode==0.1.2",
]
kwargs["test_suite"] = "nose.collector"
kwargs["extras_require"] = {
@@ -49,13 +53,13 @@ setup(
url="https://github.com/RDFLib/rdflib",
license="BSD-3-Clause",
platforms=["any"],
- python_requires=">=3.6",
+ python_requires=">=3.7",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
"License :: OSI Approved :: BSD License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: OS Independent",