From 6b48a9b0b2e899fa7a453ab86c9b9b4dcb87a229 Mon Sep 17 00:00:00 2001 From: Jan Range Date: Tue, 7 May 2024 22:49:23 +0200 Subject: [PATCH] adapt to `src` move --- CONTRIBUTING.rst | 10 +++++----- MANIFEST.in | 2 +- pyproject.toml | 8 +++++--- tests/conftest.py | 3 ++- tox.ini | 26 +++++++++++++------------- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 51d4143..697eac4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -229,7 +229,7 @@ you created the branch, check the section on :ref:`updating a PR `. -From here, you now can move forward to +From here, you now can move forward to - contribute to the documentation (see below) - contribute to the :ref:`code base ` @@ -267,7 +267,7 @@ Some other important things to know about the docs: - The pyDataverse documentation consists of two parts: - the docstrings in the code itself and - - the docs in the folder ``src/pyDataverse/doc/`` + - the docs in the folder ``pyDataverse/doc/`` - The docstrings provide a clear explanation of the usage of the individual functions, while the documentation consists of tutorial-like overviews per topic together with some other information (what’s new, installation, this page you're viewing right now, etc). - The docstrings follow the `Numpy Docstring Standard `_. @@ -298,7 +298,7 @@ to ``upstream/develop``, so you have to branch-off from it too. There is one exception: If you want to suggest a change to the docs in the folder -``src/pyDataverse/docs/`` (e. g. fix a typo in +``pyDataverse/docs/`` (e. g. fix a typo in :ref:`User Guide - Basic Usage `), you can also pull to ``upstream/master``. This means, you have also to branch-off from the ``master`` branch. @@ -411,7 +411,7 @@ To run black alone, use .. code-block:: shell - black src/pyDataverse/file_changed.py + black pyDataverse/file_changed.py .. _contributing_code_type-hints: @@ -430,7 +430,7 @@ type hints. After making any change you can ensure your type hints are correct b .. code-block:: shell - mypy src/pyDataverse/file_changed.py + mypy pyDataverse/file_changed.py .. _contributing_code_testing-with-ci: diff --git a/MANIFEST.in b/MANIFEST.in index 9cab79a..f37f118 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -recursive-include src/pyDataverse/schemas * +recursive-include pyDataverse/schemas * diff --git a/pyproject.toml b/pyproject.toml index 47d1577..ec74e69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,17 +2,19 @@ name = "pyDataverse" version = "0.3.2" description = "A Python module for Dataverse." -authors = ["Stephan Kasberger "] +authors = [ + "Stephan Kasberger ", + "Jan Range ", +] license = "MIT" readme = "README.md" repository = "https://github.com/gdcc/pyDataverse" -packages = [{ include = "pyDataverse", from = "src" }] +packages = [{ include = "pyDataverse" }] [tool.poetry.dependencies] python = "^3.8.1" httpx = "^0.27.0" jsonschema = "^4.21.1" -urllib3 = "^2.2.1" [tool.poetry.group.dev] optional = true diff --git a/tests/conftest.py b/tests/conftest.py index 8b32cd0..bee6947 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """Find out more at https://github.com/GDCC/pyDataverse.""" + import os import pytest from pyDataverse.api import NativeApi @@ -9,7 +10,7 @@ def test_config(): test_dir = os.path.dirname(os.path.realpath(__file__)) root_dir = os.path.dirname(test_dir) test_data_dir = os.path.join(test_dir, "data") - json_schemas_dir = os.path.join(root_dir, "src/pyDataverse/schemas/json") + json_schemas_dir = os.path.join(root_dir, "pyDataverse/schemas/json") test_data_output_dir = os.path.join(test_data_dir, "output") invalid_filename_strings = ["wrong", ""] invalid_filename_types = [(), [], 12, 12.12, set(), True, False] diff --git a/tox.ini b/tox.ini index ed5c4a3..3b3c173 100644 --- a/tox.ini +++ b/tox.ini @@ -49,20 +49,20 @@ description = pylint for linting deps = -r{toxinidir}/requirements/lint.txt commands = - pylint src/pyDataverse/ + pylint pyDataverse/ pylint tests/ [testenv:mypy] deps = -r{toxinidir}/requirements/lint.txt commands = - mypy src/pyDataverse/ setup.py tests/ + mypy pyDataverse/ setup.py tests/ [flake8] max-line-length = 80 ignore = E129 exclude = - src/pyDataverse/docs/source/conf.py + pyDataverse/docs/source/conf.py .tox .egg @@ -73,7 +73,7 @@ deps = commands = pip uninstall -y flake8-pytest-style pip uninstall -y flake8-rst-docstrings - flake8 src/pyDataverse/ + flake8 pyDataverse/ [testenv:flake8_docs] description = flake8 for style guide and docstring testing @@ -88,7 +88,7 @@ commands = pip uninstall -y flake8-comprehensions pip uninstall -y flake8-requirements pip uninstall -y flake8-return - flake8 --docstring-convention numpy src/pyDataverse/ + flake8 --docstring-convention numpy pyDataverse/ flake8 --docstring-convention numpy tests/ [testenv:flake8_tests] @@ -103,7 +103,7 @@ description = black for auto-formatting deps = -r{toxinidir}/requirements/lint.txt commands = - black src/pyDataverse/ + black pyDataverse/ black tests/ [testenv:pre-commit] @@ -116,14 +116,14 @@ description = invoke sphinx-build to build the HTML docs deps = -r{toxinidir}/requirements/docs.txt commands = - sphinx-build -d src/pyDataverse/docs/build/docs_doctree src/pyDataverse/docs/source docs/build/html --color -b html {posargs} + sphinx-build -d pyDataverse/docs/build/docs_doctree pyDataverse/docs/source docs/build/html --color -b html {posargs} [testenv:pydocstyle] description = pydocstyle for auto-formatting deps = -r{toxinidir}/requirements/docs.txt commands = - pydocstyle src/pyDataverse/ + pydocstyle pyDataverse/ pydocstyle tests/ [testenv:packaging] @@ -133,7 +133,7 @@ recreate = True deps = -r{toxinidir}/requirements/packaging.txt commands = - # rm -R {toxinidir}/src/pyDataverse.egg-info + # rm -R {toxinidir}/pyDataverse.egg-info # rm -R {toxinidir}/dist # rm -R {toxinidir}/build python setup.py sdist bdist_wheel @@ -169,14 +169,14 @@ description = Radon McCabe number deps = -r{toxinidir}/requirements/lint.txt commands = - radon cc src/pyDataverse/ -a + radon cc pyDataverse/ -a [testenv:radon-mi] description = Radon Maintainability Index deps = -r{toxinidir}/requirements/lint.txt commands = - radon mi src/pyDataverse/ + radon mi pyDataverse/ radon mi tests/ [testenv:radon-raw] @@ -184,7 +184,7 @@ description = Radon raw metrics deps = -r{toxinidir}/requirements/lint.txt commands = - radon raw src/pyDataverse/ + radon raw pyDataverse/ radon raw tests/ [testenv:radon-hal] @@ -192,5 +192,5 @@ description = Radon Halstead metrics deps = -r{toxinidir}/requirements/lint.txt commands = - radon hal src/pyDataverse/ + radon hal pyDataverse/ radon hal tests/