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

chore: tweak configs to match pyramid #89

Merged
merged 3 commits into from
Nov 9, 2023
Merged

Conversation

tseaver
Copy link
Member

@tseaver tseaver commented Nov 4, 2023

Suppress warnings where possible (some still emitted by 'build', but they match those from Pyramid).

Discovered while chasing down local tox failures on my machine.

Suppress warnings where possible (some still emitted by 'build',
but they match those from Pyramid).
Copy link
Member

@digitalresistor digitalresistor left a comment

Choose a reason for hiding this comment

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

I've left inline comments.

Comment on lines +70 to +71
$ python3 -m venv env
$ env/bin/pip install -e .[docs,testing]
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't install a local copy. I don't during dev. tox will install and run tests in their own virtualenvs across the supported versions of Python.

Copy link
Member Author

Choose a reason for hiding this comment

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

Lots of development requires being able to do things like set breakpoints in code to examine state: this environment is intended to support that, not automated testing.

Copy link
Member

Choose a reason for hiding this comment

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

Even within a tox run you can set breakpoints and the like, and now you are actually testing what the end result will be (a wheel) vs potential other things that are in the python path because of the directory you are in. I know we switched to src directory on purpose, but tox makes it cleaner and easier to not accidentally be testing/validating something that is not the same as what will be tested in CI/CD.


4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$ git checkout -b name-of-your-bugfix-or-feature
$ git switch -c name-of-your-bugfix-or-feature

Using git checkout is not recommend by git anymore due to confusion related to what it means to do a checkout.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you point me to a reference for that recommendation? The basic branching and merging chapter of the official git book still uses checkout -b.

Copy link
Member

Choose a reason for hiding this comment

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

https://linuxhandbook.com/git-switch-checkout/

https://git-scm.com/docs/git-switch

git switch was explicitly added to stop confusion around what "checkout" does since checkout was overloaded.

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

To run a subset of tests::

$ env/bin/py.test tests.test_venusian
Copy link
Member

Choose a reason for hiding this comment

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

tox -e py38 -- tests.test_venusian

Will do the same thing, and doesn't require a local installation that may be out of date, and will cause tox to update the right versions of dependencies and the like.

Copy link
Member Author

Choose a reason for hiding this comment

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

See above: I don't use tox this way, but always have a separate virtual env for actual development. The fact that tox does not install a development copy is the entire point of having a virtual env which does.

@tseaver tseaver merged commit 966cce8 into main Nov 9, 2023
31 checks passed
@tseaver tseaver deleted the tseaver-lint_cleanups branch November 9, 2023 20:31
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.

2 participants