Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docs Occurrences of requests.Response #199

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

shoeffner
Copy link
Collaborator

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 encode/httpx#3091)

Describe your environment

On host:

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

Inside container:

  • OS: I think the python images use ubuntu, but didn't check
  • pyDataverse: this PR (i.e., main branch + patches)
  • Python: 3.11
  • 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

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change? make replace parameter work in edit_dataset_metadata #146 is partially affected by this as it changes the params argument of put_request.
  • 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.
  • Have you read the Code of Conduct? Yes.
  • Do your changes in a separate branch. Branches MUST have descriptive names.
  • Have you merged the latest changes from upstream to your branch? Yes

Describe the PR

  • What kind of change does this PR introduce?
    • Mostly docs
  • 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)
  • Put Closes #ISSUE_NUMBER to the end of this pull request

Testing

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

Commits

  • Have descriptive commit messages with a short title (first line).
  • Use the commit message template
  • 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

  • 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

  • Have you used pre-commit?
  • 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

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 [1])

  [1]: encode/httpx#3091

Closes gdcc#198.
@JR-1991 JR-1991 self-requested a review July 19, 2024 07:41
Copy link
Member

@JR-1991 JR-1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks! Approved.

@JR-1991 JR-1991 self-assigned this Jul 19, 2024
@JR-1991 JR-1991 added the pkg:docs Documentation related activities label Jul 19, 2024
@JR-1991 JR-1991 added this to the 0.3.4 milestone Jul 19, 2024
@JR-1991 JR-1991 merged commit 61fd859 into gdcc:main Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:docs Documentation related activities
Projects
Development

Successfully merging this pull request may close these issues.

Update Docs to Better Reflect the Change from requests to httpx
2 participants