FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Create tox environment for running tests by dgorelik · Pull Request #144 · google/python-spanner-orm · GitHub

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

Filter by extension

Filter by extension .ini  (1) dotfile  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions .gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Empty file.
28 changes: 28 additions & 0 deletions tox.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

(nit) Remove 3.6, add 3.9.


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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

frozendict

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

(nit) This is out of date.

portpicker
Comment on lines +10 to +15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Back | FazBrowse Home | New Git URL