Skip to content

Commit 0542464

Browse files
authored
Merge pull request #47 from dhellmann/pin-doc-test-version
pin python version in doc build test
2 parents fa113fa + 6be4cda commit 0542464

File tree

7 files changed

+15
-12
lines changed

7 files changed

+15
-12
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
python-version:
19+
- 3.7
1920
- 3.8
2021
- 3.9
2122
- "3.10"
@@ -141,7 +142,7 @@ jobs:
141142
# Pin this low because RTD doesn't seem to adopt new
142143
# versions quickly and this ensures we don't have a
143144
# dependency problem with importlib.metadata.
144-
python-version: "3.9"
145+
python-version: "3.7"
145146

146147
- name: Install dependencies
147148
run: python -m pip install tox

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ syntax: re
3636
^web/
3737
.python-version
3838
.eggs
39+
/virtualenvwrapper/version.py

docs/requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# sphinxcontrib-bitbucket
22
# sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
33
sphinx
4-
# We need importlib.metadata, which was added in 3.10.
5-
importlib_metadata;python_version<'3.10'

docs/source/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# serve to show the default.
1414

1515
import datetime
16-
import importlib.metadata
16+
17+
import virtualenvwrapper.version
1718

1819
# If extensions (or modules to document with autodoc) are in another directory,
1920
# add these directories to sys.path here. If the directory is relative to the
@@ -51,7 +52,7 @@
5152
# built documents.
5253
#
5354
# The short X.Y version.
54-
version = importlib.metadata.version('virtualenvwrapper')
55+
version = virtualenvwrapper.version.version
5556
# The full version, including alpha/beta/rc tags.
5657
release = version
5758

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ classifiers = [
1313
"License :: OSI Approved :: MIT License",
1414
"Programming Language :: Python",
1515
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.7",
1617
"Programming Language :: Python :: 3.8",
1718
"Programming Language :: Python :: 3.9",
1819
"Programming Language :: Python :: 3.10",
@@ -27,7 +28,7 @@ dynamic = ["version"]
2728
keywords = ["virtualenv"]
2829
license = {text = "MIT"}
2930
readme = "README.txt"
30-
requires-python = ">=3.8"
31+
requires-python = ">=3.7"
3132

3233
dependencies = [
3334
"virtualenv",
@@ -37,6 +38,7 @@ dependencies = [
3738

3839
# https://github.com/pypa/setuptools_scm/
3940
[tool.setuptools_scm]
41+
write_to = "virtualenvwrapper/version.py"
4042

4143
[project.urls]
4244
homepage = "https://virtualenvwrapper.readthedocs.io/"

tests/test_virtualenvwrapper.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ test_virtualenvwrapper_script_set() {
2727
}
2828

2929
test_virtualenvwrapper_version() {
30-
source "$test_dir/../virtualenvwrapper.sh"
30+
load_wrappers
3131
typeset ver=$(_virtualenvwrapper_version)
3232
assertTrue "version is empty" "[ -n $ver ]"
3333
}
3434

3535
test_virtualenvwrapper_help_shows_version() {
36-
source "$test_dir/../virtualenvwrapper.sh"
36+
load_wrappers
3737
typeset pattern="Version: $(_virtualenvwrapper_version)"
3838
assertTrue "version not in command output" "virtualenvwrapper | grep \"$pattern\""
3939
}

virtualenvwrapper/hook_loader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
import os
1414
import sys
1515

16-
from stevedore import ExtensionManager
17-
from stevedore import NamedExtensionManager
16+
from stevedore import ExtensionManager, NamedExtensionManager
17+
18+
import virtualenvwrapper.version
1819

1920
LOG_FORMAT = '%(asctime)s %(levelname)s %(name)s %(message)s'
2021

@@ -89,8 +90,7 @@ def main():
8990
options, args = parser.parse_args()
9091

9192
if options.version:
92-
import importlib.metadata
93-
print(importlib.metadata.version('virtualenvwrapper'))
93+
print(virtualenvwrapper.version.version)
9494
return 0
9595

9696
root_logger = logging.getLogger('virtualenvwrapper')

0 commit comments

Comments
 (0)