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 readme with Usage instructions #39

Merged
merged 13 commits into from
Apr 13, 2023

Conversation

Sheila-nk
Copy link
Collaborator

@Sheila-nk Sheila-nk commented Mar 2, 2023

  • refined the project's description
  • added a usage section with installation and import instructions
  • added an integration example using the DockerSpawner draft PR

Closes #37

@Sheila-nk
Copy link
Collaborator Author

Ping @GeorgianaElena

The ReadTheDocs build is failing and I think it is because of the pydata-sphinx-theme v0.13.0 which was released a couple of days ago. There is this note on the pypi page that it might not be compatible with the most recent version of Sphinx which I believe we are using according to the build logs.

Note This theme may not work with the latest major versions of Sphinx, especially if they have only recently been released. Please give us a few months of time to work out any bugs and changes when new releases are made.

Do you think we should pin the pydata-sphinx-theme extension to the lower version before the compatibility issue is sorted?

@manics
Copy link
Member

manics commented Mar 2, 2023

Since RTD is a "production" deployment of our docs we could pin all deps and let dependabot bump them?

If you want we could also switch to jupyterhub-sphinx-theme jupyterhub/team-compass#524

@Sheila-nk
Copy link
Collaborator Author

Sheila-nk commented Mar 3, 2023

@manics Thanks for the suggestion. I have looked over the jupyterhub-sphinx-theme and the JupyterHub Python Repo Template Draft PR using it. I like it and I think we should go ahead and make the switch too.
So I will work on:

  • making a draft PR using the jupyterhub-sphinx-theme
  • creating a dependabot.yml configuration file to update dependencies

@Sheila-nk Sheila-nk added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Mar 3, 2023
@Sheila-nk Sheila-nk marked this pull request as draft March 8, 2023 09:29
@Sheila-nk Sheila-nk marked this pull request as ready for review March 16, 2023 08:29
@Sheila-nk
Copy link
Collaborator Author

Ping @GeorgianaElena could you please help review this PR?

README.md Outdated Show resolved Hide resolved
README.md Outdated
[![Latest PyPI version](https://img.shields.io/pypi/v/pytest-jupyterhub?logo=pypi)](https://pypi.python.org/pypi/pytest-jupyterhub)
[![Documentation status](https://img.shields.io/readthedocs/pytest-jupyterhub?logo=read-the-docs)](https://pytest-jupyterhub.readthedocs.io/en/latest/?badge=latest)
[![GitHub Workflow Status - Test](https://img.shields.io/github/workflow/status/jupyterhub/pytest-jupyterhub/Test?logo=github&label=tests)](https://github.com/jupyterhub/pytest-jupyterhub/actions)
[![Test coverage of code](https://codecov.io/gh/jupyterhub/pytest-jupyterhub/branch/main/graph/badge.svg)](https://codecov.io/gh/jupyterhub/pytest-jupyterhub)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

@Sheila-nk Sheila-nk Mar 21, 2023

Choose a reason for hiding this comment

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

I am not sure I understand what you mean by 'public', but we have not set up the project on codecov yet. I don't think I have the relevant permissions for that. I can delete this badge for now until that is done.

Copy link
Member

Choose a reason for hiding this comment

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

codecov doesn't look to be setup for this repo yet. I believe it makes sense to not have a badge for it.
Also, @Sheila-nk, can you please open up an issue about enabling codecov for this repo?

README.md Outdated
@@ -17,8 +29,63 @@ For more information on Fixtures, check out this [pytest documentation](https://
A **Mock** is an object that simulates the behavior of another object such as a class or function. They are used to simulate the behavior of real objects for testing purposes.
For more information on Mocks, check out this [unittest documentation](https://docs.python.org/3/library/unittest.mock.html) on the mock module.

**Example:**
### Example
Copy link
Member

@manics manics Mar 20, 2023

Choose a reason for hiding this comment

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

Is it worth deleting this "Example" section? It's a bit confusing having two "Example" sections in the README, and this one goes into a lot of technical detail. The usage example you've added below seems much more relevant and helpful to readers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, I agree. I will remove this example section.

README.md Outdated

# [Reusable JupyterHub Pytest Plugin](https://github.com/jupyterhub/pytest-jupyterhub)

[![Latest PyPI version](https://img.shields.io/pypi/v/pytest-jupyterhub?logo=pypi)](https://pypi.python.org/pypi/pytest-jupyterhub)
Copy link
Member

Choose a reason for hiding this comment

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

If we're adding a pypi badge with link we should push something there to claim ownership, even if it's a placeholder package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@GeorgianaElena suggested we make an alpha release of this project. We can hold on adding the pypi badge until that is done.

Copy link
Member

Choose a reason for hiding this comment

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

@Sheila-nk, can you please open an issue about making a release and adding the corresponding docs, GitHub workflow, badge, etc, to make sure we keep track of it? Thank you ❤️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here it is: #45
You can add any steps I have missed or remove any unnecessary ones.

@Sheila-nk Sheila-nk requested a review from manics March 23, 2023 08:03
README.md Outdated

Each of these hub components and the hub itself define their own testing infrastructure, building everything from the ground up using the **pytest** framework. And some of this complex work is either repetitive across JupyterHub sub-projects, or under-specified for some of them. This has sparked a need to abstract these common parts into a separate testing framework.
Each of these hub components and the hub itself define their own testing infrastructure, building everything from the ground up using the [**pytest**](https://docs.pytest.org/en/7.2.x/) framework. And some of this complex work is either repetitive across JupyterHub sub-projects, or under-specified for some of them. This has sparked a need to abstract these common parts into a separate testing framework.
Copy link
Member

Choose a reason for hiding this comment

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

Let's link to the pytest stable or latest docs, instead of a certain version, as it might not always be the version used by this project.

README.md Outdated

To use the **JupyterHub Pytest Plugin**, you will first need to install it using pip by either:

- installing it locally
Copy link
Member

Choose a reason for hiding this comment

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

I believe it's worth leaving a note here about the fact that we're instructing to install the package from GitHub because the package was not yet released on PyPI. And then change the install instruction once that's done. Also, adding this to a todo list, somewhere in an issue to not forget, will be also a good idea.

README.md Outdated

- installing it locally
```bash
pip install --upgrade pip
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this step, as upgrading pip is not a requirement of the project.

README.md Outdated
Comment on lines 39 to 44
- adding it to the `requirements.txt` file of your project:

```python
# in requirements.txt
git+https://github.com/jupyterhub/pytest-jupyterhub.git@main
```
Copy link
Member

Choose a reason for hiding this comment

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

This is subject to how each project is managing their dependencies, and it's hard and not recommended to cover all cases, so let's remove and leave it to each project to define.

README.md Outdated
Comment on lines 48 to 51
```bash
pip install --upgrade pip
pip install -r requirements.txt
```
Copy link
Member

Choose a reason for hiding this comment

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

When installing a package with pip install git+https://github.com/jupyterhub/pytest-jupyterhub.git@main, its dependencies get installed also.

Plus, we're defining the pytest-jupyterhub's deps in pyproject.toml and don't actually have a requirements.txt file in this repo, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yes! That is my mistake. All dependencies are defined in pyproject.toml. No requirements.txt file for this project, except for the docs.

README.md Outdated
## Usage

To use a specific fixture or mock, import it from its module in the `pytest_jupyterhub` package:

```python
from pytest_jupyterhub.jupyterhub_spawners import hub_app
```
Copy link
Member

Choose a reason for hiding this comment

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

The pytest docs describe differently how to use a plugin in a test suite: https://docs.pytest.org/en/7.1.x/how-to/writing_plugins.html#requiring-loading-plugins-in-a-test-module-or-conftest-file

Is there a reason why we're taking a different approach here and importing the fixtures same like we'd do from a regular Python package?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, true. I might need to change the DockerSpawner draft PR as well since I imported it instead of loading the plugin. Thank you for catching this.

@Sheila-nk
Copy link
Collaborator Author

@GeorgianaElena I have worked on the recommended changes and added a contributing section to this README. Please review the changes and let me know if they are ready for merging.

@Sheila-nk Sheila-nk added the documentation Improvements or additions to documentation label Apr 11, 2023
Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

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

This looks great to me! I made two code suggestions that I think makes sense.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@consideRatio
Copy link
Member

@Sheila-nk btw amazing README.md file, I love it! It does a perfect job introducing a reader I think - it doesn't assume too much knowledge ahead of time and onboards the reader, and it doesn't try to explain too much either. Perfectly balanced in my mind!

Sheila-nk and others added 2 commits April 13, 2023 15:42
Co-authored-by: Erik Sundell <[email protected]>
Co-authored-by: Erik Sundell <[email protected]>
@Sheila-nk
Copy link
Collaborator Author

@Sheila-nk btw amazing README.md file, I love it! It does a perfect job introducing a reader I think - it doesn't assume too much knowledge ahead of time and onboards the reader, and it doesn't try to explain too much either. Perfectly balanced in my mind!

Thank you @consideRatio for your kind words and review ❤️

@consideRatio consideRatio merged commit 264a2aa into jupyterhub:main Apr 13, 2023
@Sheila-nk Sheila-nk deleted the update-readme branch April 13, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update README file
4 participants