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

DOC Adding more details on how to contribute to the library #1131

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rcap107
Copy link
Contributor

@rcap107 rcap107 commented Oct 29, 2024

Very early and rough draft for some improvements to the page on how to contribute to skrub. Follow-up on #1130, and still very much a work in progress.

I added some of the points that I mentioned in the issue, and some examples. As I already said, this is an early draft that we could use for discussing what should be added, and wording and stuff.

I would like to add something more on writing doctests and maybe be more specific when it comes to CI, but I don't know enough about either do do that 😅

A checklist of the operations that should be performed for the PR (pre-commit, write tests, update the changelog etc.)

  • How to run tests using a specific environment with pixi on the local machine for debugging
  • How to check for code coverage on the local machine
  • How to check doctests
  • Some information on where the code for testing is, and how to structure tests
  • The documentation style to use (numpydoc)

@rcap107 rcap107 changed the title Adding more details on how to contribute to the library DOC Adding more details on how to contribute to the library Oct 29, 2024
Copy link
Contributor

@TheooJ TheooJ left a comment

Choose a reason for hiding this comment

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

Such a useful page, thanks a lot @rcap107 !

Makes me wonder if we want to add doc to the optional dependencies of the dev page, currently it's just pip install -e ".[dev, lint, test]"

CONTRIBUTING.rst Outdated Show resolved Hide resolved
CONTRIBUTING.rst Outdated Show resolved Hide resolved
CONTRIBUTING.rst Outdated
and update the file ``skrub/tests/test_table_vectorizer.py`` so that it
takes into account the new transformer.

Additionally, you might have updated the dataframe API in
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't mention the dataframe API in skrub, you could say something like "have implemented some dispatched functions"

Copy link
Member

Choose a reason for hiding this comment

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

Right, the internal dataframe API maybe?

CONTRIBUTING.rst Outdated

.. code:: sh

pytest --doctest-modules skrub/path/to/file
Copy link
Contributor

Choose a reason for hiding this comment

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

Or just

Suggested change
pytest --doctest-modules skrub/path/to/file
pytest skrub/path/to/file

as you wish

Copy link
Contributor

Choose a reason for hiding this comment

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

Sometimes I also found it useful to test examples with python examples/my_example.py


.. code:: sh

pixi run -e ci-py309-min-optional-deps pytest skrub/tests/path/to/test
Copy link
Contributor

Choose a reason for hiding this comment

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

To be honest pixi has a learning curve but this functionality is very helpful !

rcap107 and others added 2 commits October 30, 2024 22:34
Co-authored-by: Théo Jolivet <57430673+TheooJ@users.noreply.github.com>
Co-authored-by: Théo Jolivet <57430673+TheooJ@users.noreply.github.com>
Copy link
Member

@Vincent-Maladiere Vincent-Maladiere left a comment

Choose a reason for hiding this comment

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

Hey @rcap107, this is a very helpful addition, here are some feedback

CONTRIBUTING.rst Outdated
@@ -126,6 +126,12 @@ Setting up the environment

Follow the steps in the :ref:`installation_instructions` > "From Source" section to
set up your environment.
Make sure that pre-commit hooks are enabled, and run the test suite:
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 already mentioned in the install guide, section 4. "run the tests", do you think it's not highlighted enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I slightly reworded this section to explain what's different in the installation from source.

CONTRIBUTING.rst Show resolved Hide resolved
CONTRIBUTING.rst Outdated Show resolved Hide resolved
CONTRIBUTING.rst Outdated
and update the file ``skrub/tests/test_table_vectorizer.py`` so that it
takes into account the new transformer.

Additionally, you might have updated the dataframe API in
Copy link
Member

Choose a reason for hiding this comment

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

Right, the internal dataframe API maybe?

CONTRIBUTING.rst Outdated Show resolved Hide resolved
CONTRIBUTING.rst Outdated Show resolved Hide resolved

pytest skrub/tests/test_amazing_transformer.py

All tests should pass before submitting the code.
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 suggest a command there, maybe with pixi?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what command you're suggesting

Copy link
Member

Choose a reason for hiding this comment

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

A command to run all tests?

rcap107 and others added 2 commits November 8, 2024 11:34
Co-authored-by: Vincent M <maladiere.vincent@yahoo.fr>
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.

3 participants