Skip to content

Conversation

@joscha
Copy link

@joscha joscha commented Feb 27, 2025

This adds a very simple Bearer authentication class.

Happy to add docs, if accepted.

#### Code

1) Create a new branch based on `develop` branch.
* Optional: create and enable virtualenv:
Copy link
Author

Choose a reason for hiding this comment

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

I used a virtualenv here as I didn't want to pollute my local machine with extra packages. Thought it might be useful for others, too.

```
2) Fetch all dev dependencies.
* Install required python modules using `pip`: **python -m pip install .[testing]**
* Install required python modules using `pip`: **python -m pip install ".[testing]"**
Copy link
Author

Choose a reason for hiding this comment

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

my shell (zsh) didn't like the [ and ] without quoting them.


[project.optional-dependencies]
testing = [
"pytest==8.3.4",
Copy link
Author

Choose a reason for hiding this comment

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

I am not sure why this was missing here, I assume it comes with pytest-cov in whatever version is deemed suitable there.


[tool.setuptools]
py-modules = [
"httpx_auth"
Copy link
Author

Choose a reason for hiding this comment

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

this is needed for:

Processing /Users/joscha/dev/httpx_auth
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [93 lines of output]
      No `packages` or `py_modules` configuration, performing automatic discovery.
      `flat-layout` detected -- analysing .
      discovered packages -- ['httpx_auth', 'myenv', 'httpx_auth._oauth2', 'myenv.bin', 'myenv.include', 'myenv.lib']

possibly related to the virtualenv?

@@ -0,0 +1,3 @@
[pytest]
asyncio_mode = auto
Copy link
Author

Choose a reason for hiding this comment

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

Without this, I get:

INTERNALERROR> pytest.PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope

@@ -0,0 +1,3 @@
[pytest]
asyncio_mode = auto
asyncio_default_fixture_loop_scope = "function"
Copy link
Author

Choose a reason for hiding this comment

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

and without this I get:
Screenshot 2025-02-27 at 1 18 34 pm

@sonarqubecloud
Copy link

@joscha
Copy link
Author

joscha commented Mar 6, 2025

^ ping @Colin-b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant