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

docs(contributing): add contribution and new-container guide #460

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

totallyzen
Copy link
Collaborator

@totallyzen totallyzen commented Mar 9, 2024

change

Document how to contribute, with initial focus on making local development smooth.

Tasks

  • Finish the new-container guide
  • Remove any old docs referring to
  • Update README.md to point at the contribution guide
  • Update README.md to add badges (supported python versions, etc) and to give kudos to current and past maintainers and contributors

@totallyzen
Copy link
Collaborator Author

@jankatins @bearrito @max-pfeiffer your comments are very welcome - It's still in draft, but it's a start!

This is what I had time for today, but will continue on the weekday evenings!

@totallyzen
Copy link
Collaborator Author

@santi also, this will be useful for you!

- `pyenv` **Recommended**: For installing python versions for your system.
Poetry infers the current latest version from what it can find on the `PATH` so you are still fine if you don't use `pyenv`.

### Build and test
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm using the devcontainers workflow. I could add in a section on using that if you wanted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hey @bearrito apologies for the delays, I'm finding myself with some time today.
I'd love your contribution on the devcontainers workflow, but lemme finish this PR (ETA today, finally found the time to work on this) and then yo can raise your own PR for that addition to the docs 🙏

.github/ISSUE_TEMPLATE/new-container.md Outdated Show resolved Hide resolved
.github/ISSUE_TEMPLATE/new-container.md Outdated Show resolved Hide resolved
@alexanderankin alexanderankin force-pushed the docs/improve-contribution-guide branch 2 times, most recently from 88752d1 to 2124686 Compare March 9, 2024 22:50
@alexanderankin
Copy link
Collaborator

looks good to me, i find this stuff very valuable but right now i dont really know what to add as far as suggestions or discussion. my head is mostly in the outstanding PRs and releases and such.

also sorry for the double rebase. i did a rebase locally onto main. then i found a button on github, but the button on github gave me credit for all your work, so then i just pushed my local rebase.

@alexanderankin
Copy link
Collaborator

it might also make sense to capture what it takes to implement a new container, not just request one

@alexanderankin
Copy link
Collaborator

quick summary of how to test buildthedocs changes:

  1. make a new project on buildthedocs
  2. "import" your fork of this repository
  3. push changes and test there
    1. significant files: /.readthedocs.yml, /Makefile (the make docs target, specifically), /conf.py (the sphinx stuff), /docs/_build (preview the result locally)
  4. then open pr here

Makefile Show resolved Hide resolved
@max-pfeiffer
Copy link
Contributor

it might also make sense to capture what it takes to implement a new container, not just request one

Yes, I think so too. We could briefly elaborate about the best practices that we want to see in contributions. So modules are a bit more consistent.

Maybe also what to include in README.rst in the modules directory. To me it's not clear what purpose that serves currently.

@max-pfeiffer
Copy link
Contributor

max-pfeiffer commented Mar 24, 2024

I would say also our .pre-commit-config.yaml also needs some attention: there we have black for code formatting and ruff as linter defined.
What about just using ruff? ruff can format code as well and is pretty fast in doing that. Then we can drop that black dependency.

I like badges 😃. So would could add the following badges:

  • Poetry
  • ruff
  • supported Python versions
  • pipeline status
  • test coverage Codecov, see my comment on the make file for running tests with pytest-cov

@totallyzen Can I add commits to this PR? Then I could quickly contribute my suggestions.

@totallyzen
Copy link
Collaborator Author

totallyzen commented Mar 25, 2024

Can I add commits to this PR? Then I could quickly contribute my suggestions.

Yes, please do!
Including the black -> ruff transition as long as it doesn't reformat the entire repo 🙂
If we are to improve/fix formatting, I want that to be in another PR.

@bearrito actually, I think given my lack of time lately, you could contribute the devcontainers setup to this PR as well, just ping the request on this PR as well so I can track 🙏

@jankatins
Copy link
Contributor

Including the black -> ruff transition as long as it doesn't reformat the entire repo 🙂

Ruff is compatible with black apart from a very few and rare differences. I've several repos here where black and ruff format are interchangeable :-)

.github/CONTRIBUTING.md Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
... based on @jankatins

Co-authored-by: Jan Katins <jan.katins@katzien.de>
@bearrito
Copy link
Contributor

@totallyzen I can do that. It will either be today or tomorrow. Likely tomorrow.

@bearrito
Copy link
Contributor

@totallyzen Can I get this approved if it looks okay- #506 Namely I want to be able to reference that work in the docs for devcontainers

@MattOates
Copy link
Contributor

MattOates commented Mar 30, 2024

As someone who just tried to raise a PR with a new container, and just checked out these new docs. Can I point out its not obvious at all on these points:

.github/workflows/main.yml to run tests, build, and publish your package when pushed to the main branch.

No such file exists.

Rebase your development branch on main (or merge main into your development branch).

Main just changed whilst I've had my PR up, is the preference I rebase and force push over the top of my already published PR constantly?

Add a line -e file:[feature name] to requirements.in

Where is requirements.in ??? If you add directly to pyproject.toml under a module is this sufficient and correct?

@totallyzen
Copy link
Collaborator Author

Hey @MattOates,

Thanks for the pointers, I'm sorry for your bad experience, but please note that this PR is a draft, I did not have time to finish it. A lot of people left comments on it, all duly noted, you can in fact raise a PR against this branch and make suggestions. 👍
You can also keep your calm about it, the current maintainers are volunteers, with sometimes very little time to spare on this. 👍

@totallyzen
Copy link
Collaborator Author

@bearrito done, I merged #506 - feel free to reference it in your next PR 🙏

Apologies for the continued delays, my work weeks have been intense/depressing/exhausting. 🙇

index.rst Outdated Show resolved Hide resolved
@santi
Copy link
Collaborator

santi commented Apr 1, 2024

Hey @MattOates sorry for your rough start here, but we really appreciate you contributions 😊 Hopefully the latest additions to the draft should make clear the things you are wondering about.

We have just revamped the whole structure and development setup in this repo, so no wonder the docs are very outdated. I hope you stay and find the new setup easier to work with 😀

Copy link
Collaborator

@santi santi left a comment

Choose a reason for hiding this comment

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

A few last comments from my end, but I think the current draft is in a good shape and ready to be released. Further contributions are of course welcome and can be added in future PRs.

Great job here @totallyzen!

for the given tools you are triyng to implement.
- This means we want you to avoid adding specific libraries as dependencies to `testcontainers`.
- Therefore, you should implement the configuration and the waiting with as little extra as possible
- You may still find it useful to add your preferred client library as a dev dependency
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- You may still find it useful to add your preferred client library as a dev dependency
- If the intended usage of the new Testcontainer is with a client library, please add the client library as a dev dependency, so that tests can mirror actual usage of the new container.

not sure if this is the best wording but maybe we encourage people to add dev dependencies instead of writing tests that never run

Copy link
Contributor

@jankatins jankatins Apr 5, 2024

Choose a reason for hiding this comment

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

Suggested change
- You may still find it useful to add your preferred client library as a dev dependency
- If the intended usage of the new Testcontainer is with a client library, please add such a client library as a dev dependency and a test which mirrors actual usage of the container.`

(e.g. PG has multiple which consume the url)

index.rst Outdated Show resolved Hide resolved
@max-pfeiffer
Copy link
Contributor

max-pfeiffer commented Apr 5, 2024

Can I add commits to this PR? Then I could quickly contribute my suggestions.

@totallyzen I just created this PR containing some badges: #528

I also picked up communications with @kiview on Slack to make code coverage reports and that codecov.io badge happen.

@max-pfeiffer
Copy link
Contributor

Yes, please do! Including the black -> ruff transition as long as it doesn't reformat the entire repo 🙂 If we are to improve/fix formatting, I want that to be in another PR.

@totallyzen I just created a PR and removed that black dependency: #529

Just a couple of files became re-formatted. So this we have rather little code changes.

I added the following badges:
- Poetry
- Ruff
- Supported Python versions
- Workflow runs
@totallyzen totallyzen marked this pull request as ready for review April 10, 2024 08:29
@totallyzen
Copy link
Collaborator Author

I'll merge this, I heard no negative comments on the existing additions and some improvements rely on main -> let's consider this PR to be "done"

@alexanderankin
Copy link
Collaborator

lgtm!

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.

None yet

7 participants