Skip to content

Commit

Permalink
Merge pull request #47 from dhellmann/pin-doc-test-version
Browse files Browse the repository at this point in the history
pin python version in doc build test
  • Loading branch information
dhellmann authored Feb 11, 2023
2 parents fa113fa + 6be4cda commit 0542464
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
fail-fast: false
matrix:
python-version:
- 3.7
- 3.8
- 3.9
- "3.10"
Expand Down Expand Up @@ -141,7 +142,7 @@ jobs:
# Pin this low because RTD doesn't seem to adopt new
# versions quickly and this ensures we don't have a
# dependency problem with importlib.metadata.
python-version: "3.9"
python-version: "3.7"

- name: Install dependencies
run: python -m pip install tox
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ syntax: re
^web/
.python-version
.eggs
/virtualenvwrapper/version.py
2 changes: 0 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# sphinxcontrib-bitbucket
# sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
sphinx
# We need importlib.metadata, which was added in 3.10.
importlib_metadata;python_version<'3.10'
5 changes: 3 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# serve to show the default.

import datetime
import importlib.metadata

import virtualenvwrapper.version

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

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -27,7 +28,7 @@ dynamic = ["version"]
keywords = ["virtualenv"]
license = {text = "MIT"}
readme = "README.txt"
requires-python = ">=3.8"
requires-python = ">=3.7"

dependencies = [
"virtualenv",
Expand All @@ -37,6 +38,7 @@ dependencies = [

# https://github.com/pypa/setuptools_scm/
[tool.setuptools_scm]
write_to = "virtualenvwrapper/version.py"

[project.urls]
homepage = "https://virtualenvwrapper.readthedocs.io/"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_virtualenvwrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ test_virtualenvwrapper_script_set() {
}

test_virtualenvwrapper_version() {
source "$test_dir/../virtualenvwrapper.sh"
load_wrappers
typeset ver=$(_virtualenvwrapper_version)
assertTrue "version is empty" "[ -n $ver ]"
}

test_virtualenvwrapper_help_shows_version() {
source "$test_dir/../virtualenvwrapper.sh"
load_wrappers
typeset pattern="Version: $(_virtualenvwrapper_version)"
assertTrue "version not in command output" "virtualenvwrapper | grep \"$pattern\""
}
Expand Down
8 changes: 4 additions & 4 deletions virtualenvwrapper/hook_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
import os
import sys

from stevedore import ExtensionManager
from stevedore import NamedExtensionManager
from stevedore import ExtensionManager, NamedExtensionManager

import virtualenvwrapper.version

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

Expand Down Expand Up @@ -89,8 +90,7 @@ def main():
options, args = parser.parse_args()

if options.version:
import importlib.metadata
print(importlib.metadata.version('virtualenvwrapper'))
print(virtualenvwrapper.version.version)
return 0

root_logger = logging.getLogger('virtualenvwrapper')
Expand Down

0 comments on commit 0542464

Please sign in to comment.