summaryrefslogtreecommitdiff
path: root/setup.cfg
Commit message (Collapse)AuthorAgeFilesLines
* build: move to poetry for dependency management; consolidate more settings ↵Jeffrey C. Lerman2023-01-171-74/+1
| | | | | | | | | | | | | | | | | | | | | | | into pyproject.toml (#2187) Replaced setuptools with poetry which provides simpler dependency management, dependency locking and virtual environment management. This makes it easier for new developers to get a sane development environment (i.e. just `poetry install`) and also makes our CI pipeline more reproducable as now most development tools and libraries will only change through dependabot which will reduce the build failures on main and make breaking changes in dependencies more visible with dependabot PRs. Other changes: - moved isort, mypy and coverage config from setup.cfg to pyproject.toml - Changes in the generated rdflib wheel: - removed wheel extras related to development (i.e. `tests`, `docs`, `dev`) as poetry dependency groups should be used instead. - Added an extra group `lxml` with a dependency on lxml. - Added version ranges to dependencies, and tests to ensure these version ranges are valid. - Changes to tests: - Change pyparsing related tests so they work with older pyparsing. - Made the html5lib related tests conditional on html5lib existing. - Runtime changes: - Use importlib.metadata to set `__version__`. - Changed the devcontainer and related config to avoid contamination and interference with the host environment. Co-authored-by: Iwan Aucamp <aucampia@gmail.com> Co-authored-by: Edmond Chuc <edmond.chuc@outlook.com>
* Fix type errors resulting from new mypy (#2161)Iwan Aucamp2022-11-191-0/+1
| | | | | | New mypy version is reporting new errors. In the long run we need to switch to poetry so we can better control this.
* test: Fix `exclude_lines` for coverage (#2093)Iwan Aucamp2022-08-231-1/+1
| | | | `exclude_lines` was only considering TYPE_CHECKING if it was preceded with at least one space.
* feat: add type hints for `rdflib.store` and `rdflib.plugins.stores` (#2057)Iwan Aucamp2022-07-301-1/+3
| | | | | | | | | | | | | | | | | | | | Add type hints and aliases for `rdflib.store` and `rdflib.plugins.stores` and also add a couple of more type hints and aliases to `rdflib.graph`. This PR contains no runtime changes. Other changes: - Changed some imports to be more specific (e.g. `import from rdflib.graph` instead of `import from rdflib`). This is to reduce the probability of circular imports. - Ignore `E231` (missing whitespace after ',') in flake8 as black is managing the whitespaces and seems to be bumping heads with flake8 with spaces after `,` sometimes. - Install `berkeleydb-stubs` when doing extensive testing with tox. - Added `devtools/diffrtpy.py` which is a script that can be used with `git difftool` to generate compact diffs for python code. This should make it a lot easier to review PRs that change type hints to verify that they don't have a runtime impact.
* build: speed up flake8 by ignoring test data (#1970)Iwan Aucamp2022-05-261-1/+5
| | | | | flake8/flakeheaven is quite slow because it scans test data directories also. This patch adds more directories to flake8 ignore so that flake8/flakeheaven can run faster.
* Fix `GraphHelper.quad_set` handling of DatasetIwan Aucamp2022-05-161-0/+2
| | | | | | | | | | `GraphHelper.quad_set` was doing the wrong thing for Datasets because Datasets are not exactly a subclass of ConjunctiveGraph. This adds special handling for Dataset so it works correctly. Also: - Fix some flake8 errors
* style: enable and baseline flakeheaven (#1928)Iwan Aucamp2022-05-151-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | * Enable and baseline flakeheaven This patch adds flakeheaven with a baseline, the baseline ignores all existing errors and only reports on new errors. The benefit with this approach is that we can get full flake8 on new changes without having to first address the flake8 warnings with our existing codebase. Baselined errors can still be seen with: - `flakeheaven lint --baseline /dev/null` - `flake8` This also adds a flakeheaven to GitHub Actions in a way which will result in independent reporting. Other changes: - Simplified caching behaviour in GitHub Actions - Removed flake8-black because it does not work well https://github.com/peterjc/flake8-black/issues/59 - Remove redundant/duplicated config for flake8 Co-authored-by: Christian Clauss <cclauss@me.com>
* Merge pull request #1855 from aucampia/iwana-20220419T1752-coverage_ignoreIwan Aucamp2022-04-211-0/+6
|\ | | | | Tell coveragepy to ignore type checking code and `...`
| * Tell coveragepy to ignore type checking code and `...`Iwan Aucamp2022-04-191-0/+6
| | | | | | | | | | | | | | This is so we can get a more accurate picture of coverage. For more info see: - https://github.com/nedbat/coveragepy/issues/831
* | docs: switch to sphinx-autodoc-typehintsIwan Aucamp2022-04-191-0/+2
|/ | | | | | | | | | | | | | | | | | | | Currently rdflib is relying on sphinx-autodoc's built in handling for type hints, this however has some deficiencies as it does not handle stuff inside `if TYPE_CHECKING:` and thus only work in cases where there are no potential for circular dependencies. This patch changes sphinx to use sphinx-autodoc-typehints instead, the documentation generated by this plugin looks slightly different but as a positive it correctly works with things defined inside `if TYPE_CHECKING:` guards. Also: - moved the `_NamespaceSetString` type alias to `rdflib._type_checking` This is so that `sphinx-autodoc-typehints` recognizes it up, as it does not handle type aliases that are defined inside `if TYPE_CHECKING:` guards in imported files. - remove sphinx requirements from requirements.dev.txt and replaced it with -r docs/sphinx-requirements.txt to reduce redundancy.
* text: fix pytest configIwan Aucamp2022-04-181-14/+0
| | | | | | | | | | | | | | | | | | | | | | | pytest was using config from `tox.ini` preferentially and ignoring config from `setup.cfg`, as a side-effect doctests were not running on code/docstrings in `rdflib/`. The reason why some pytest config was in `tox.ini` instead of `setup.cfg` was because of these issues: - https://github.com/pypa/pip/issues/5182 - https://github.com/pytest-dev/pytest/issues/3062 As a compromise to fix this I have opted for moving all pytest config to `pyproject.toml`: - https://docs.pytest.org/en/stable/reference/customize.html#pyproject-toml This seems sensible as `pyproject.toml` is standarized by PEPs and eventually most things from `setup.cfg` will end up in there anyway. Also: - remove the pytest ignore on `test/translate_algebra` as tests in there have been running and passing for some time. - fixed path to test data in `rdflib/plugins/parsers/nquads.py`.
* style: fix isort configIwan Aucamp2022-04-151-19/+20
| | | | | | | | `isort` was misconfigured to only touch `*.{pyw,pyi}` files. This patch fixes isort config so that it actually does sort imports. It also removes the attempt to ignore the test directory.
* Ignore pyparsing type hintsIwan Aucamp2022-04-101-0/+6
| | | | | | | | The type hints from pyparsing 3.0.8 does not work for rdflib: https://github.com/pyparsing/pyparsing/issues/385 Once the type hints for pyparsing is in a better state we can enable them again.
* Add isort (#1689)eggplants2022-02-211-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | * add: isort configure file * fix: isort $ isort . * add: isort to dev deps * add: isort to CI * fix: move .isort.cfg into setup.cfg * fix: re-formatted * fix: isort target path * Use pre-commit to check isort pre-commit CI can auto fix this, and this way we can idenpendently evaluate the formatting of the code from the validity of the code. Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
* Unify plugin loadingIwan Aucamp2022-01-301-4/+5
| | | | | | | | | | | | Plugin loading in `rdflib.plugins.sparql` will now happen similar to what is being done for `rdflib.plugins`. This also eliminates a warning that occurs `rdflib.plugins.sparql` and makes it possible to enable `warn_unused_ignores` without any exceptions or workarounds. Also: - Removed unused `type: ignore` statements.
* Add typing to rdflib.termIwan Aucamp2022-01-221-0/+6
| | | | | | | | | | | | | | | This adds as much typing as possible to `rdflib.term`. Other changes: - Added back `warn_unused_ignores`. I actually thought this was enabled but I forgot I disabled it because of some issue on python 3.10. - Disabled `warn_unused_ignores` only for `rdflib.plugin`. There is an ignore in this module which is not needed on python 3.10, this is the most targetted way to avoid having that fail the type checking that I can think of for now. - Removed unused type ignores. This changeset includes no runtime changes.
* Convert translate_algebra tests to pytestIwan Aucamp2021-12-311-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As far as I can tell all the tests inside test/translate_algebra basically did the following: ```python query_tree = parser.parseQuery(self.query_text) query_algebra = algebra.translateQuery(query_tree) self.query_from_algebra = translateAlgebra(query_algebra) query_tree_2 = parser.parseQuery(self.query_from_algebra) query_algebra_2 = algebra.translateQuery(query_tree_2) self.query_from_query_from_algebra = translateAlgebra(query_algebra_2) _pprint_query(self.query_from_query_from_algebra) ``` One test tried to also execute the query, but against a None valued variable. And then there was some exception handling in specific place. This change converts all of this to pytest using parameterization. There are two tests that fail, and seem to also fail in the old test structure, they are: ```python AlgebraTest( "test_other__service1", "Test if a nested service pattern is properly translated" "into the query text.", pytest.mark.xfail(raises=RecursionError), ), AlgebraTest( "test_property_path__negated_property_set", "Test if a negated property set gets properly translated into the query text.", pytest.mark.xfail(raises=TypeError, reason="fails in translateAlgebra"), ), ``` The `test_other__service1` causes some more serious issues on Windows so it is guarded in a condition to only run it on non Windows operating systems.
* Fix typing errors in testsIwan Aucamp2021-12-281-5/+0
| | | | | | | | Also removed mypy config to ignore errors in tests. This will make tests useful for determining if the typing of rdflib is correct and sane and should also help detect if a change in rdflib introduces typing errors in tests.
* Fix typoAlex Nelson2021-12-211-1/+1
|
* Fix mypy settings to run select test files in strict modeIwan Aucamp2021-12-191-0/+9
| | | | | | | | | | | | | | | - Changed all mypy invocation to not include paths and moved the paths to the mypy section in setup.cfg. This removes redudancy in directory specification and reduces the potential that directories are changed in one invocation but not others. - Ignore mypy errors in test directory. - Enable strict mypy config with in-file config comments in the following files: - test/test_issue1447.py - test/test_issue_git_336.py - test/test_literal.py - test/test_parse_file_guess_format.py
* Change python version used for mypy to 3.7Iwan Aucamp2021-12-161-1/+1
| | | | | | | | Support for python version 3.6 is dropped, and using 3.6 prevents certain features from python 3.7 from being useable without type failures. Fixes #1513
* Ignore some spurious warnings caused by pytestIwan Aucamp2021-11-131-0/+5
| | | | | pytest's behaviour causes some spurious warnings during test, this commit configures pytest to ignore them.
* Migrate from nosetest to pytestIwan Aucamp2021-10-241-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replace all uses of nose with pytest. It also includes a pytest plugin for creating EARL reports for tests with a `rdf_test_uri` parameter. Some caveats: - HTML report directory is now htmlcov instead of coverage - There is some warning related to the EARL reporting plugin which I can't quite figure out: ``` .venv/lib64/python3.7/site-packages/_pytest/config/__init__.py:676 /home/iwana/sw/d/github.com/iafork/rdflib/.venv/lib64/python3.7/site-packages/_pytest/config/__init__.py:676: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: test.earl self.import_plugin(import_spec) ``` This is not causing any problems as far as I can tell, but still annoying. - python setup.py test won't work anymore, I can make it work but this is not advised by pytest: https://github.com/pytest-dev/pytest-runner/#deprecation-notice - run_test.py is still there but it's not really referenced anymore from anywhere and the options it accepts are completely different as it's options were based on nose. I would say it should be removed entirely but for now it is basically just a wrapper around pytest that basically does nothing. - Removed references to test attributes as currently they are not being used anywhere anyway, I guess we can add them back if there is some use for them later. - A lot of tests are still marked to skip when really they should be marked with xfail. This is also affecting the RDFT test manifests and result in reports saying tests are skipped when really we know they will fail and they are only skipped for this reason. But there is no change here from before, and pytest makes it easier to dynamically do expected failures. Special thanks to Wes Turner for his advice and inputs on this process.
* Use pytest instead of noseNatanael Arndt2021-10-181-2/+1
|
* Add py.typed as per PEP 561Iwan Aucamp2021-09-211-1/+3
| | | | | | | | | | | | This is so that other packages importing rdflib does not get warnings like this: ``` $ python3.9 -m mypy --show-error-context --show-error-codes test_rdflib.py test_rdflib.py:1: error: Skipping analyzing "rdflib": found module but no type hints or library stubs [import] test_rdflib.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports Found 1 error in 1 file (checked 1 source file) ```
* Fix mypy type errors and add mypy to .drone.ymlIwan Aucamp2021-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | Fixes #1311 Add `mypy` to .drone.yml and fix type errors that come up. Not type checking examples or tests. Other changes: - fix return value for `Graph.serialize` (refs #1394) - remove default value for `rdflib.plugins.sparql.algebra.translateAlgebra` (refs #1322) - add .dockerignore to reduce context size and make docker quicker to run. - add .flake8 config to ignore line length as black is managing formatting. - add mypy to docker-compose, makefile and tox.ini - fix the way csv2rdf is invoked to ensure that the right code gets executed.
* Remove mypy from CI pipelines and requirements.dev.txtIwan Aucamp2021-06-031-0/+6
| | | | | Also move mypy config into `setup.cfg` to be in line with other tool configuration.
* Remove the path sectionNatanael Arndt2021-03-011-12/+0
| | | | | This section appears to be left over. It is only necessary in combination with coverage combine, which we are not using.
* remove outcommented configuration from setup.cfgNatanael Arndt2021-03-011-9/+0
|
* Move coverage configuration to setup.cfgNatanael Arndt2021-03-011-0/+37
|
* Move flake8 configNatanael Arndt2021-01-281-0/+5
| | | | | | | remove .pep8 as we don't use it move the pep8 configuration to setup.cfg set line length to the default value of black, as we use black adjust travis configuration
* remove format_doctest from py3compatGunnar Aastrand Grimnes2017-01-311-0/+2
| | | | replaced with doctest-ignore-unicode noseplugin
* remove double exclude line as py3 configparser complains otherwiseJoern Hees2015-03-181-2/+1
|
* make external_graph_libs tests optional (only run if ext lib is installed)Joern Hees2015-03-181-0/+1
| | | | | | | | networkx shouldn't be a dependency of rdflib just to run tests. Also graph_tool heavily depends on C libs and can't easily be installed via pip (or via apt-get on travis). Hence, the doctests are duplicated into proper tests that auto skip if networkx or graph_tool can't be imported.
* Revert to mainstream, temporarily suspend doctests.Graham Higgins2013-04-121-6/+4
|
* Immigrate rdflib-sparql (plus some prefiguring changes)Graham Higgins2013-03-211-1/+1
|
* Re-enable doctests, adjust docstrings for use with py3compat.Graham Higgins2012-02-181-3/+3
|
* removed bits that are causing the release to have .dev_r0 tacked on the end ↵3.0.0eikeon2010-05-131-4/+0
| | | | of it
* added \!manual to setup.cfg; marked failing test cases as known_issueeikeon2009-04-091-1/+1
|
* annotated tests with attributes known_issue, slow, non_core and sparql to ↵eikeon2009-04-021-2/+3
| | | | make it easier to run the various groups of tests; and make the default be tests that match the following: \!known_issue,\!slow,\!non_core,\!sparql
* figure out how to exclude rdflib.store for now; not sure why it's not ↵eikeon2007-03-121-0/+2
| | | | ignoring test.mysql
* added bit to configure 'setup.py nosetests' to run doc testseikeon2007-03-121-0/+6
|
* added continuous-releases-using-subversion biteikeon2007-03-111-0/+3