Skip to content

Commit

Permalink
chore(gae): remove region tags from 'taskqueue' folder (#13085)
Browse files Browse the repository at this point in the history
* chore(gae): add support for Python 3 to requirements-test.txt

* chore(gae): remove region tags from migration/taskqueue/pull-counter/main.py

* chore(gae): add requirements-test.txt and requirements-test.txt

* chore(gae): remove region tags from taskqueue/counter/worker.py

* chore(gae): add requirements-test.txt and requirements-test.txt

* chore(gae): remove region tags from taskqueue/pull-counter/main.py
  • Loading branch information
eapl-gemugami authored Jan 22, 2025
1 parent d5d008a commit 72190ce
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
4 changes: 0 additions & 4 deletions appengine/standard/migration/taskqueue/pull-counter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START all]
"""A simple counter with a Pub/Sub pull subscription, replacing a
TaskQueue pull queue, which is not available in Python 3 App Engine
runtimes.
Expand Down Expand Up @@ -99,9 +98,6 @@ def start_handling_tasks():
return "Done" # Never reached except under test


# [END all]


if __name__ == "__main__":
# This is used when running locally only. When deploying to Google App
# Engine, a webserver process such as Gunicorn will serve the app. This
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
pytest==7.0.1 ; python_version >= "3.0"
# pin pytest to 4.6.11 for Python2.
pytest==4.6.11; python_version < '3.0'

# pytest==8.3.4 and six==1.17.0 for Python3.
pytest==8.3.4; python_version >= '3.0'
six==1.17.0
6 changes: 6 additions & 0 deletions appengine/standard/taskqueue/counter/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# pin pytest to 4.6.11 for Python2.
pytest==4.6.11; python_version < '3.0'

# pytest==8.3.4 and six==1.17.0 for Python3.
pytest==8.3.4; python_version >= '3.0'
six==1.17.0
1 change: 1 addition & 0 deletions appengine/standard/taskqueue/counter/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 0 additions & 3 deletions appengine/standard/taskqueue/counter/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START all]

from google.appengine.ext import ndb
import webapp2

Expand Down Expand Up @@ -41,4 +39,3 @@ def update_counter():


app = webapp2.WSGIApplication([("/update_counter", UpdateCounterHandler)], debug=True)
# [END all]
5 changes: 0 additions & 5 deletions appengine/standard/taskqueue/pull-counter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START all]
"""A simple counter with App Engine pull queue."""

import logging
Expand Down Expand Up @@ -41,16 +40,13 @@ def get(self):
counter_template = JINJA_ENV.get_template("counter.html")
self.response.out.write(counter_template.render(template_values))

# [START adding_task]
def post(self):
key = self.request.get("key")
if key:
queue = taskqueue.Queue("pullq")
queue.add(taskqueue.Task(payload="", method="PULL", tag=key))
self.redirect("/")

# [END adding_task]


@ndb.transactional
def update_counter(key, tasks):
Expand Down Expand Up @@ -91,4 +87,3 @@ def get(self):
app = webapp2.WSGIApplication(
[("/", CounterHandler), ("/_ah/start", CounterWorker)], debug=True
)
# [END all]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# pin pytest to 4.6.11 for Python2.
pytest==4.6.11; python_version < '3.0'

# pytest==8.3.4 and six==1.17.0 for Python3.
pytest==8.3.4; python_version >= '3.0'
six==1.17.0
1 change: 1 addition & 0 deletions appengine/standard/taskqueue/pull-counter/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 72190ce

Please sign in to comment.