Skip to content

Commit

Permalink
Adding tox support for AppVeyor.
Browse files Browse the repository at this point in the history
In the process, fixing some Windows PATH issues in
"gcloud._helpers" and associated tests.
  • Loading branch information
dhermes committed Sep 2, 2016
1 parent 808cc01 commit 26626a2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
8 changes: 7 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,38 @@ environment:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.11"
PYTHON_ARCH: "32"
TOX_ENV: "py27"

- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.11"
PYTHON_ARCH: "64"
TOX_ENV: "py27"

# Python 3.4.4 is the latest Python 3.4 with a Windows installer
# Python 3.4.4 is the overall latest
# https://www.python.org/ftp/python/3.4.4/
- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4.4"
PYTHON_ARCH: "32"
TOX_ENV: "py34"

- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.4"
PYTHON_ARCH: "64"
TOX_ENV: "py34"

# Python 3.5.1 is the latest Python 3.5 with a Windows installer
# Python 3.5.1 is the overall latest
# https://www.python.org/ftp/python/3.5.1/
- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.1"
PYTHON_ARCH: "32"
TOX_ENV: "py35"

- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.1"
PYTHON_ARCH: "64"
TOX_ENV: "py35"

install:
- ECHO "Filesystem root:"
Expand Down Expand Up @@ -83,7 +89,7 @@ build_script:
test_script:
- "%CMD_IN_ENV% pip list"
# Run the project tests
- "%CMD_IN_ENV% py.test"
- "%CMD_IN_ENV% tox -e %TOX_ENV%"

after_test:
# If tests are successful, create binary packages for the project.
Expand Down
1 change: 1 addition & 0 deletions appveyor/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# target Python version and architecture
wheel
pytest
tox
cryptography
grpcio >= 1.0rc1
grpc-google-pubsub-v1
Expand Down
4 changes: 3 additions & 1 deletion gcloud/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
(?P<nanos>\d{1,9}) # nanoseconds, maybe truncated
Z # Zulu
""", re.VERBOSE)
DEFAULT_CONFIGURATION_PATH = '~/.config/gcloud/configurations/config_default'
_USER_ROOT = os.path.expanduser('~')
DEFAULT_CONFIGURATION_PATH = os.path.join(_USER_ROOT, '.config', 'gcloud',
'configurations', 'config_default')


class _LocalStack(Local):
Expand Down
6 changes: 4 additions & 2 deletions unit_tests/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ def setUp(self):
if self.temp_APPDATA: # pragma: NO COVER Windows
os.environ['APPDATA'] = self.temp_config_path

self.config_path = os.path.join(os.getenv('APPDATA', '~/.config'),
'gcloud', 'configurations')
config_default = os.path.join(os.path.expanduser('~'), '.config')
config_dir = os.getenv('APPDATA', config_default)
self.config_path = os.path.join(config_dir, 'gcloud',
'configurations')
conf_path = os.path.join(self.temp_config_path, self.config_path)
os.makedirs(conf_path)
self.temp_config_file = os.path.join(conf_path, self.config_file)
Expand Down

0 comments on commit 26626a2

Please sign in to comment.