Skip to content

Commit

Permalink
Add Python 3.11 support (#12256)
Browse files Browse the repository at this point in the history
Co-authored-by: Travis Hathaway <travis.j.hathaway@gmail.com>
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
  • Loading branch information
3 people committed Apr 17, 2023
1 parent 330fa91 commit 7ec97d6
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
fail-fast: false
matrix:
default-channel: ['defaults', 'conda-forge']
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
conda-subdir: ['win-64']
test-type: ['unit', 'integration']
test-group: ['1', '2', '3']
Expand All @@ -73,7 +73,7 @@ jobs:
- default-channel: 'conda-forge'
python-version: '3.8'
- default-channel: 'conda-forge'
python-version: '3.10'
python-version: '3.11'
env:
OS: Windows
PYTHON: ${{ matrix.python-version }}
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
fail-fast: false
matrix:
default-channel: ['defaults', 'conda-forge']
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
test-type: ['unit', 'integration']
test-group: ['1', '2', '3']
exclude:
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
fail-fast: false
matrix:
default-channel: ['defaults', 'conda-forge']
python-version: ['3.10']
python-version: ['3.11']
platform: ['arm64', 'ppc64le']
env:
OS: linux-${{ matrix.platform }}
Expand Down
2 changes: 1 addition & 1 deletion conda/cli/conda_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ def configure_parser_install(sub_parsers):
Install a specific version of 'python' into an environment, myenv::
conda install -p path/to/myenv python=3.10
conda install -p path/to/myenv python=3.11
"""
)
Expand Down
12 changes: 6 additions & 6 deletions docs/source/dev-guide/development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,24 @@
By default, it will use Miniconda-based, Python 3.9 installation configured for
the `defaults` channel. You can customize this with two environment variables:

- `CONDA_DOCKER_PYTHON`: `major.minor` value; e.g. `3.10`.
- `CONDA_DOCKER_PYTHON`: `major.minor` value; e.g. `3.11`.
- `CONDA_DOCKER_DEFAULT_CHANNEL`: either `defaults` or `conda-forge`

For example, if you need a conda-forge based 3.10 image:
For example, if you need a conda-forge based 3.11 image:

**Bash (macOS, Linux, Windows)**

```bash
$ CONDA_DOCKER_PYTHON=3.10 CONDA_DOCKER_DEFAULT_CHANNEL=conda-forge docker compose build --no-cache
$ CONDA_DOCKER_PYTHON=3.11 CONDA_DOCKER_DEFAULT_CHANNEL=conda-forge docker compose build --no-cache
# --- in some systems you might also need to re-supply the same values as CLI flags:
# CONDA_DOCKER_PYTHON=3.10 CONDA_DOCKER_DEFAULT_CHANNEL=conda-forge docker compose build --no-cache --build-arg python_version=3.10 --build-arg default_channel=conda-forge
$ CONDA_DOCKER_PYTHON=3.10 CONDA_DOCKER_DEFAULT_CHANNEL=conda-forge docker compose run interactive
# CONDA_DOCKER_PYTHON=3.11 CONDA_DOCKER_DEFAULT_CHANNEL=conda-forge docker compose build --no-cache --build-arg python_version=3.11 --build-arg default_channel=conda-forge
$ CONDA_DOCKER_PYTHON=3.11 CONDA_DOCKER_DEFAULT_CHANNEL=conda-forge docker compose run interactive
```

**cmd.exe (Windows)**

```batch
> set CONDA_DOCKER_PYTHON=3.10
> set CONDA_DOCKER_PYTHON=3.11
> set CONDA_DOCKER_DEFAULT_CHANNEL=conda-forge
> docker compose build --no-cache
> docker compose run interactive
Expand Down
3 changes: 1 addition & 2 deletions docs/source/user-guide/tasks/manage-python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Managing Python
Conda treats Python the same as any other package, so it is easy
to manage and update multiple installations.

Anaconda supports Python 3.7, 3.8, 3.9 and 3.10. The current default is
Python 3.9.
Conda supports Python 3.8, 3.9, 3.10, and 3.11.

Viewing a list of available Python versions
===========================================
Expand Down
3 changes: 2 additions & 1 deletion docs/source/user-guide/tasks/use-conda-with-travis-ci.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The .travis.yml file

The following code sample shows how to modify the ``.travis.yml``
file to use `Miniconda <https://conda.io/miniconda.html>`_ for a
project that supports Python 3.7, 3.8, 3.9 and 3.10:
project that supports Python 3.7, 3.8, 3.9, 3.10, and 3.11:

.. code-block:: yaml
Expand All @@ -37,6 +37,7 @@ project that supports Python 3.7, 3.8, 3.9 and 3.10:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
install:
# We do this conditionally because it saves us some downloading if the
# version is the same.
Expand Down
19 changes: 19 additions & 0 deletions news/12256-python-3.11
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* Add Python 3.11 support. (#12256)

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
]
Expand Down Expand Up @@ -64,7 +65,7 @@ include = ["conda", "conda_env"]
version-file = "conda/__version__.py"

[tool.black]
target-version = ['py38', 'py39', 'py310']
target-version = ['py38', 'py39', 'py310', 'py311']

[tool.isort]
profile = "black"
Expand Down
1 change: 1 addition & 0 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ python:
- 3.8
- 3.9
- 3.10
- 3.11
4 changes: 1 addition & 3 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,7 @@ def test_create_no_deps_flag(self):
assert not package_is_installed(prefix, "itsdangerous")

def test_create_only_deps_flag(self):
with make_temp_env(
"python=2", "flask", "--only-deps", no_capture=True
) as prefix:
with make_temp_env("python", "flask", "--only-deps", no_capture=True) as prefix:
assert not package_is_installed(prefix, "flask")
assert package_is_installed(prefix, "python")
if not on_win:
Expand Down

0 comments on commit 7ec97d6

Please sign in to comment.