pyDataverse icon indicating copy to clipboard operation
pyDataverse copied to clipboard

Update Docs Occurrences of requests.Response

Open shoeffner opened this issue 1 year ago • 0 comments

Replace all occurrences of requests.Reponse with httpx.Response.

Also do some minor documentation updates, including some formatting and removal of example texts. Include :special-members: for the API interface, as the auth-parameter will be documented in the init method, and the docs of the context manager for async were not published yet. Additionally, remove the intersphinx reference to requests. Unfortunately, httpx does not have an inventory file (see also https://github.com/encode/httpx/discussions/3091)

Describe your environment

On host:

  • [x] OS: macOS, Sonoma 14.5, M1
  • [x] pyDataverse: this PR (i.e., main branch + patches)
  • [x] Python: 3.12
  • [x] Dataverse: 6.3 (local/container), 6.2 (demo.dataverse.org)

Inside container:

  • [x] OS: I think the python images use ubuntu, but didn't check
  • [x] pyDataverse: this PR (i.e., main branch + patches)
  • [x] Python: 3.11
  • [x] Dataverse: 6.3 (!) -- had to override DV_VERSION in docker-compose-test-all.yml to make tests pass, as many check for the version

Follow best practices

  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change? #146 is partially affected by this as it changes the params argument of put_request.
  • [x] Have you followed the guidelines in our Contribution Guide? Yes, but it seems a little outdated. Will create a follow-up issue for this one to update it.
  • [x] Have you read the Code of Conduct? Yes.
  • [x] Do your changes in a separate branch. Branches MUST have descriptive names.
  • [x] Have you merged the latest changes from upstream to your branch? Yes

Describe the PR

  • [x] What kind of change does this PR introduce?
    • Mostly docs
  • [x] Why is this change required? What problem does it solve?
    • The docs still mention requests, but this is no longer true. Requests and httpx have mostly compatible, but slightly different APIs, so this can cause confusion. (I was confused while debugging datalad/datalad-dataverse#...
  • [ ] Screenshots (if appropriate)
  • [x] Put Closes #ISSUE_NUMBER to the end of this pull request

Testing

  • [x] Have you used tox and/or pytest for testing the changes? pytest, sh run-tests.sh
  • [x] Did the local testing ran successfully? yes (caveat: I applied #197)
  • [ ] Did the Continuous Integration testing (Travis-CI) ran successfully?

Commits

  • [x] Have descriptive commit messages with a short title (first line).
  • [x] Use the commit message template
  • [x] Put Closes #ISSUE_NUMBER in your commit messages to auto-close the issue that it fixes (if such).

Others

  • [ ] Is there anything you need from someone else?

Documentation contribution

  • [x] Have you followed NumPy Docstring standard? I hope so, but there are still a few instances of :class:\...`` which I did not resolve in this PR.

Code contribution

  • [x] Have you used pre-commit?
  • [x] Have you formatted your code with black prior to submission (e. g. via pre-commit)?
  • [ ] Have you written new tests for your changes? no
  • [ ] Have you ran mypy on your changes successfully? haven't run it
  • [ ] Have you documented your update (Docstrings and/or Docs)? no
  • [ ] Do your changes require additional changes to the documentation? no

Closes #198

shoeffner avatar Jul 18 '24 23:07 shoeffner