Skip to content

Commit

Permalink
Use .python-version-default as default (#58)
Browse files Browse the repository at this point in the history
To leave .python-version for the user
  • Loading branch information
hynek committed Jun 13, 2023
1 parent 3051afc commit 523e3fd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@ You can (and should) run our test suite using [*tox*].
However, you’ll probably want a more traditional environment as well.

First, create a virtual environment so you don't break your system-wide Python installation.
We recommend using the Python version from the `.python-version` file in project's root directory.
We recommend using the Python version from the `.python-version-default` file in project's root directory.

If you're using [*direnv*](https://direnv.net), you can automate the creation of a virtual environment with the correct Python version by adding the following `.envrc` to the project root after cloning the repository:

```bash
layout python python$(cat .python-version)
layout python python$(cat .python-version-default)
```

If you're using tools that understand `.python-version` files like [*pyenv*](https://github.com/pyenv/pyenv) does, you can make it a link to the `.python-version-default` file.

---

[Create a fork](https://github.com/pyca/service-identity/fork) of the *service-identity* repository and clone it:

```console
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ env:
FORCE_COLOR: "1" # Make tools pretty.
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
# N.B. default Python version for setup-python comes from the .python-version
# file at the root of the project.


jobs:
Expand All @@ -26,6 +24,7 @@ jobs:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version-file: .python-version-default
cache: pip

- name: Install & run tox
Expand Down Expand Up @@ -87,6 +86,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version-file: .python-version-default
cache: pip

- uses: actions/download-artifact@v3
Expand Down Expand Up @@ -121,6 +121,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version-file: .python-version-default
cache: pip

- name: Install & run tox
Expand All @@ -140,6 +141,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version-file: .python-version-default
cache: pip

- name: Install in dev mode & import
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
default_language_version:
# keep in-sync with .python-version
# keep in-sync with .python-version-default
python: python3.11

repos:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ commands =


[testenv:coverage-report]
# keep in-sync with .python-version
# keep in-sync with .python-version-default
base_python = py311
deps = coverage[toml]>=5.0.2
skip_install = true
Expand Down

0 comments on commit 523e3fd

Please sign in to comment.