Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ __pycache__
cloud-spanner-emulator*
emulator_main
gateway_main
.spanner_emulator/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) add / at the beginning of the line, so it only matches in this directory.

Empty file added spanner_emulator/.keep
Empty file.
28 changes: 28 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py36, py37, py38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) Remove 3.6, add 3.9.


[testenv]
deps =
absl-py
google-api-core
google-cloud-spanner >= 1.17.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) This doesn't match the other places, but I don't know what it should be.

frozendict
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) This is out of date.

portpicker
Comment on lines +10 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to keep this in sync with other places? E.g. could we put this in a requirements.txt or something, and reference that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While these can be put in a requirements.txt file, I don't think setup.py should be referencing that file, so there still would be duplication
https://stackoverflow.com/a/33685899

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up adding the below in a different PR because of the same issue with setup.py not referencing requirements.txt. Would it make sense to add requirements.txt here, and use it both for tox and the github workflow? Or would the github workflow use tox and not need to reference the dependencies explicitly anymore?

pytest
allowlist_externals =
wget
tar
chmod
setenv =
SPANNER_EMULATOR_VERSION=1.2.0
SPANNER_EMULATOR_BINARY_PATH=.spanner_emulator/emulator_main
commands =
wget https://storage.googleapis.com/cloud-spanner-emulator/releases/{env:SPANNER_EMULATOR_VERSION}/cloud-spanner-emulator_linux_amd64-{env:SPANNER_EMULATOR_VERSION}.tar.gz -P .spanner_emulator/
tar zxvf .spanner_emulator/cloud-spanner-emulator_linux_amd64-{env:SPANNER_EMULATOR_VERSION}.tar.gz -C .spanner_emulator/
chmod u+x .spanner_emulator/gateway_main .spanner_emulator/emulator_main
pytest