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

conda python310 #1

Closed
wants to merge 91 commits into from
Closed

conda python310 #1

wants to merge 91 commits into from

Conversation

mlech-reef
Copy link

maciej-lech and others added 30 commits March 29, 2020 15:56
* Force adding group to an option

* Update tests
* Address wntrblm#319: Give a create_tmp API

* more stuff

* fade to black

* woops

* calculate tmp directly from envdir

* cleanup and fix tests
Fix overwritten and environment typos in virtualenv.py
* Typo: Controling -> Controlling

Typo in usage.rst

* Update usage.rst

Co-authored-by: Thea Flowers <magicalgirl@google.com>
* New global option `nox.options.venv_backend` to set the default backend. Fixes wntrblm#315

* Added doc about the new option

* Blackened

* fixed tests

* Fixed docs

* Fixed coverage by adding tests for the venv_backend_completer

* fixed test

* Added tests for short and long versions of the new option.

* Replaced the venv_backend completer with a simple `choices` from argparse :)

* Renamed venv_backend to default_venv_backend, and created new force_venv_backend

* New "none" choice for venv_backends, equivalent to python=False

* Updated doc concerning default_venv_backend and force_venv_backend, as well as the new 'none' backend

* Fixed all manifest tests

* Fixed test_tasks for venv_backend

* Fixed coverage

* Blackened code

* The warning message was appearing for all sessions, even those deselected. It is now only logged when session is run.

* Added `--no-venv` option. Fixes wntrblm#301

* Blackened

* Fixed tests

* Improved coverage

* Blackened

* Fixed an issue with parametrization: warning would not be issued. Added corresponding tests. This should make coverage happy, too.

* Blackened

* Now `install` and `conda_install` work when there is no venv backend (or python=False). Previously a `ValueError` was raised. Fixes wntrblm#318

* Fixed test

* Minor edit to trigger CI build again as it seems stuck.

* Minor doc fix to trigger the CI again (appveyor false fail)

Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
* initial pass, some tests failing

* lint

* hopefully fixed linting on 3.5
…ound was not the correct one (wntrblm#310)

* Virtual environments now have a `bin_paths` attribute instead of a single `bin`. `command.run` and `which` both have their `path` argument renamed `paths` and supporting a list of paths, to handle it. Fixes wntrblm#256

* Updated tests to handle the `paths` renaming of the `path` argument in `nox.command.run`, and the `bin` to `bin_paths` renaming in `virtualenv`

* First conda test on windows

* Black-ened code

* As per code review: Added a backwards-compatible `session.bin` property

* Fixed lint error

* Added back `bin` to all envs for compatibility with legacy api

Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
* Offline mode is now auto-detected by default by `conda_install`. This allows users to continue executing nox sessions on already installed environments. This behaviour can be disabled by setting `auto_offline=False`. Fixes wntrblm#313

* Fixed args order for offline option and added tests

* Black-ened code

* Fixed conda options order again

* Added a log message when doing auto-offline

* Fixed mypy errors

* Fixed mypy errors (2)

* mypy fix (3)

* Fixed last failing test

* Improved coverage

* Last coverage fix ?

* Blackened

* Last Flake8 fix

* removed dependency to `requests`

* removed dependency to `urllib3`

* Simplified offline checks

* fixed import

* fixed test

* Added pragma no cover

Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
…d when needed. (wntrblm#312)

* `conda_install` and `install` args are now automatically double-quoted when they contain a `<` or a `>`. Fixes wntrblm#311

* Added a test for the double-quoting fix

* Black-ened

* Improving coverage: added some tests and improved error checking in _dblquote_pkg_install_arg

* Blackened

* Fixed mypy error

* Fixed test

* Now double-quoting arguments only for `conda_install`, not `install`. Apparently, `pip` does not need it.

* Fixed mock error in test

* blackened

* Fixed lint error and code review related mod of comments

Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
* Fully annotate the session decorator

Previously the decorator would obscure the
function type.

* Try to get setuptools working on Travis

See pypa/setuptools#2353.

* fixup! Fully annotate the session decorator

* Add `@overload` to coverage excludes
When merging options specified in the noxfile and on the command-line option, do
not use the output parameter `command_args` as the input for the merge; instead,
copy `command_args` initially and pass the copy to the merge functions.

Merge functions such as `_session_filters_merge_func` inspect `command_args` to
see if other options have been specified on the command-line. When the options
are merged in place, this check produces false positives.

For example, `nox.options.sessions` is copied into `command_args` as a part of
the merge; so it will appear to have been specified on the command-line when
merging `nox.options.pythons`, causing the latter to be ignored.

Co-authored-by: Claudio Jolowicz <cjolowicz@localhost.localdomain>
…eywords (wntrblm#359)

* Add test fixture to generate noxfile.py

The noxfile.py is templated with the default session (`nox.options.sessions`),
and the default Python version (`nox.options.pythons`), as well as an alternate
Python version.

This allows us to avoid the situation where a test case running on one Python
version needs to launch Nox using another Python version. As a side-effect, it
makes the test cases a bit more explicit.

* Add test case for using --pythons with nox.options.sessions

* Add test case for using --sessions with nox.options.pythons

* Do not ignore nox.options.pythons when --{sessions,keywords} passed

* Do not ignore nox.options.{sessions,keywords} when --pythons passed

* Rename _{session_filters => sessions_and_keywords}_merge_func

Revert function name to the one used before --pythons was introduced.
* Update parameters to match latest python releases.

* update setup.py, other references to 3.5

* don't use miniconda 3.8 even though https://www.appveyor.com/docs/windows-images-software/ mentions it
Run the blacken session on the codebase.
* Add test for resolving python3.10

* Support double-digit minor version in `python` keyword

This fixes an issue where "3.10" is resolved as "python3".
Type checkers cannot solve an aliased, generic callable.
wntrblm#361)

* feat: support users specifying an undeclared parametrization of python

Co-authored-by: Danny Hermes <daniel.j.hermes@gmail.com>
Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>
…lm#372. (wntrblm#373)

Co-authored-by: Santos Gallegos <santos_g@outlook.com>
Co-authored-by: Christopher Wilcox <crwilcox@google.com>
That method is making use of `_simple_fmt`,
but isn't defined in the class.
I used the same value as `NoxFormatter`
cjolowicz and others added 29 commits June 12, 2021 22:29
* Remove redundant mock in test for environment reuse

This breaks tests comparing a string from pyvenv.cfg to command output, because
the latter will be a mock. There is no inherent need for this mock. It was added
recently, and probably speculatively or for performance reasons.

* Add test case for reusing Python 2 environments

* Read base prefix from pyvenv.cfg if present

* Remove trailing newline when querying interpreter base prefix
* Hide staleness check behind a feature flag

* Set feature flag for staleness check in unit tests

* Set feature flag for staleness check in Python 2 test
* chore: upgrade to mypy 0.902

Uses the new pyproject.toml configuration and much tighter checking, nearly --strict

* fix: adding pragma no cover for static if

Co-authored-by: Claudio Jolowicz <mail@claudiojolowicz.com>
* Remove setup.py

Editable installs for projects with a setup.cfg no longer require a setup.py
shim. This requires pip >= 21.1 (2021-04-24).

* Remove setup.py from blacken and lint sessions

* CI: Use python -m build in deploy job
* Add header from noxfile.py docstring wntrblm#454

This commit adds the functionality for using the `noxfile.py` module
docstring as a header description for the `nox -l` option.

The module docstring is now an attribute in `Manifest` which is
now populated in `discover_manifest` which is in-turn passed
to `honor_list_request` which will print the docstring if it is
present, and do nothing if it is not present.

I've also added two tests which cover these conditions (existent and
non-existent module docstring) and added to an existing
parametrized test.

* Standardise printed docstring whitespace

Co-authored-by: Claudio Jolowicz <mail@claudiojolowicz.com>
* Add friendlier message if no noxfile.py

Fixes wntrblm#462.

Add a friendlier message on the specific case that user is calling
nox from within a directory with no noxfile.

Existing test for this case modified and two additional tests
added to ensure lower level errors are still handled further down.

* Standardise no noxfile found message for noxfile with different names

Co-authored-by: Claudio Jolowicz <mail@claudiojolowicz.com>
* Add python 3.10.0-rc.2 to GitHub Actions

* Make separate CI job for 3.10 to avoid conda failure

* Fix docs job in CI so that it now executes correctly
* chore: Convert old style str.format to f strings

Ran `flynt`: https://github.com/ikamensh/flynt against nox
to automatically convert `"{}".format` style strings to the
newer `f"{}"` style strings.

* Fix Lint failure by running black

* Improve readibility of some converted strings

* Run Flynt string conversion against tests/

* Change remaining str.format calls to f-strings
* Add original cwd to session properties

* Fix test

* Rename original_wd to invoked_from

* Hoist invoked_from up to the options parser

* Add test case for hidden options

* Add test case for groupless options

Co-authored-by: Thea Flowers <me@thea.codes>
* Add a "shared cache" directory

Add an "{envdir}/.shared" directory, and create an API for accesing to it.

* Don't fail  if the ".shared" directory exists

Don't raise an exception.

* Update sessions.py

Move the "shared cache" API inside of nox.sessions.Session

* Update sessions.py

Convert the "shared cache" path into a property. Now, it returns a "pathlib.Path".

* Update test_sessions.py

Make a test for the recent changes.

* Update sessions.py

Use the "pathlib.Path" methods to reduce the variable usage.

* Update test_sessions.py

Make some modifications to the tests.

* Update test_sessions.py

Fix an import error.

* Update sessions.py

Use the parent directory to create the cache dir.

* Update test_sessions.py

Use a tempfile to test the session properties.

* Fix test indent

* Update nox/sessions.py

This avoids some unnecessary path manipulations, and using the parent directory of a virtualenv which does not necessarily exist (`PassthroughEnv` does not create a virtualenv).

Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>

* Update sessions.py

Use ".cache" instead of ".shared".

* Update test_sessions.py

Use ".cache" instead of ".shared".

Co-authored-by: Tom Fleet <tomfleet2018@gmail.com>
Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>
* Hopeful python3.10.0-rc.2 CI fix

* Lets get the correct syntax this time

* Lower coverage requirement if 3.10

* Fix failing test coupled to now modified noxfile.py

* Explicitly run cover session in GHA

* Remove parametrisation in favour of explicit sys.version_info check

* Change CI workflow now cover is no longer parametrised

* Remove redundant cover session in GHA
…#480)

* Decouple test_session_completer from project's root noxfile

* Make test variables a bit more intuitive
* Add `session.warn` to output warnings

Show warnings during the session.

* Update test_sessions.py

Add a test for "session.warn"
(It is pretty similar to "test_log", but it has changed the logging level to be tested).

* Update test_sessions.py

Run black to fix linting errors.

* Update test_sessions.py

Remove an additional whiespace.
* Move configs into pyproject.toml or setup.cfg(flake8)

* Drop redundant isort multi-line-output setting
* Using `shlex.join()` when logging a command

* Backport `shlex.join()`

* Fix copy-pasta
* Add `session.debug` to show debug-level messages

A logging function to show debug-level messages.

* Add `session.debug` to show debug-level messages

Add a coverage test.
Python 3.9 is not supported yet, and 3.6 could reach its EOL soon.
* Replace to be deprecated load_module

* Satisfy mypy (sort of)

* Add tests to cover new statements

* Factor out the loader function and test seperately
* Remove redundancies on the Sphinx config file

- Remove a (duplicated?) commentary.
- Remove the "u" prefix on strngs, since they are set to Unicode by default.

* Run black

* Add `docs/conf.py` to the `blacken` session

Run black on that file, too.
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.

Conda backend messing up access rights to base conda env on Windows