Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a majority of pep8 errors in gcloud. #200

Merged
merged 6 commits into from
Oct 1, 2014

Conversation

kleyow
Copy link
Contributor

@kleyow kleyow commented Sep 28, 2014

No description provided.

@dhermes
Copy link
Contributor

dhermes commented Sep 28, 2014

I should run pep8 with 2 indents, i.e. pep8 --ignore=E111 gcloud/connection.py?

@@ -69,6 +69,7 @@ def get_connection(client_email, private_key_path):
client_email, private_key_path, scope=SCOPE)
return Connection(credentials=credentials)


def get_dataset(dataset_id, client_email, private_key_path):
"""Shortcut method to establish a connection to a particular dataset in the Cloud Datastore.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Sep 28, 2014

$ pep8 --ignore=E111 gcloud/datastore/demo/__init__.py 
gcloud/datastore/demo/__init__.py:8:80: E501 line too long (92 > 79 characters)
$ pep8 --ignore=E111 gcloud/datastore/entity.py 
gcloud/datastore/entity.py:46:80: E501 line too long (86 > 79 characters)
gcloud/datastore/entity.py:51:80: E501 line too long (83 > 79 characters)
gcloud/datastore/entity.py:58:80: E501 line too long (84 > 79 characters)
gcloud/datastore/entity.py:71:80: E501 line too long (82 > 79 characters)
gcloud/datastore/entity.py:119:80: E501 line too long (88 > 79 characters)
gcloud/datastore/entity.py:124:80: E501 line too long (85 > 79 characters)
gcloud/datastore/entity.py:138:80: E501 line too long (101 > 79 characters)
$ pep8 --ignore=E111 gcloud/storage/acl.py 
gcloud/storage/acl.py:382:80: E501 line too long (81 > 79 characters)
$ pep8 --ignore=E111 gcloud/storage/bucket.py 
gcloud/storage/bucket.py:105:80: E501 line too long (81 > 79 characters)
$ pep8 --ignore=E111 gcloud/storage/connection.py 
gcloud/storage/connection.py:467:80: E501 line too long (80 > 79 characters)
gcloud/storage/connection.py:479:80: E501 line too long (93 > 79 characters)
$ pep8 --ignore=E111 gcloud/storage/demo/__init__.py 
gcloud/storage/demo/__init__.py:8:80: E501 line too long (92 > 79 characters)
$ pep8 --ignore=E111 gcloud/storage/iterator.py 
gcloud/storage/iterator.py:149:80: E501 line too long (91 > 79 characters)
gcloud/storage/iterator.py:177:80: E501 line too long (85 > 79 characters)
$ pep8 --ignore=E111 gcloud/storage/key.py 
gcloud/storage/key.py:98:80: E501 line too long (81 > 79 characters)
gcloud/storage/key.py:211:9: E123 closing bracket does not match indentation of opening bracket's line
gcloud/storage/key.py:235:11: E123 closing bracket does not match indentation of opening bracket's line
$ pep8 --ignore=E111 gcloud/storage/test_bucket.py 
gcloud/storage/test_bucket.py:353:80: E501 line too long (80 > 79 characters)
$ pep8 --ignore=E111 gcloud/storage/test_connection.py 
gcloud/storage/test_connection.py:158:44: E241 multiple spaces after ':'
gcloud/storage/test_connection.py:173:44: E241 multiple spaces after ':'
gcloud/storage/test_connection.py:189:44: E241 multiple spaces after ':'
gcloud/storage/test_connection.py:209:44: E241 multiple spaces after ':'
gcloud/storage/test_connection.py:226:44: E241 multiple spaces after ':'
gcloud/storage/test_connection.py:276:44: E241 multiple spaces after ':'
gcloud/storage/test_connection.py:296:44: E241 multiple spaces after ':'

@dhermes
Copy link
Contributor

dhermes commented Sep 28, 2014

To fix the indents, I have been testing out a combination of pep8ify and my own solution for indenting doscstrings (which pep8ify, pyfmt and other auto-format libraries fail on).

I am happy to continue that effort after this commit gets checked in.

We also want to pass pylint, as that checks code style in addition to syntax. We can discuss that more in #179

@dhermes
Copy link
Contributor

dhermes commented Sep 28, 2014

I ran git ls-files gcloud*py and there were 13 Python files, not included in this commit.

Nine of them check out just fine:

gcloud/__init__.py
gcloud/credentials.py
gcloud/datastore/demo/__main__.py
gcloud/datastore/demo/demo.py
gcloud/datastore/helpers.py
gcloud/datastore/transaction.py
gcloud/demo.py
gcloud/storage/exceptions.py
gcloud/storage/test_exceptions.py

However, the following errors were detected:

$ pep8 --ignore=E111 gcloud/datastore/connection.py
gcloud/datastore/connection.py:76:9: E123 closing bracket does not match indentation of opening bracket's line
gcloud/datastore/connection.py:159:80: E501 line too long (81 > 79 characters)
gcloud/datastore/connection.py:229:80: E501 line too long (88 > 79 characters)
$ pep8 --ignore=E111 gcloud/datastore/query.py
gcloud/datastore/query.py:50:7: E123 closing bracket does not match indentation of opening bracket's line
gcloud/datastore/query.py:66:80: E501 line too long (93 > 79 characters)
$ pep8 --ignore=E111 gcloud/storage/demo/__init__.py
gcloud/storage/demo/__init__.py:8:80: E501 line too long (92 > 79 characters)

In addition, the file gcloud/datastore/datastore_v1_pb2.py is all kinds of messed up, but I presume we should leave it as-is. We should consider using a .gitattributes file to check it in as binary and also in #178 we should ignore this file in a programmatic PEP/pylint check.

@tseaver
Copy link
Contributor

tseaver commented Sep 29, 2014

@dhermes definitely leave the generated 'datastore_v1_pb2.py' as-is.

@@ -72,8 +72,7 @@ def _request(self, dataset_id, method, data):
"""
headers = {
'Content-Type': 'application/x-protobuf',
'Content-Length': str(len(data)),
}
'Content-Length': str(len(data)), }

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@tseaver
Copy link
Contributor

tseaver commented Sep 29, 2014

We need to debate / document the style guide (by reference / delta to whatever authoritative specs we choose), and then automate testing of them (e.g., via something like 'tox -e lint', including automating exceptions).

@dhermes
Copy link
Contributor

dhermes commented Sep 29, 2014

RE: automation, I checked out this branch and tested every .py file with pep8 --ignore=E111. If @kleyow likes, we can do the whitespace fixes here too, or I'm happy to do it with pep8ify and my custom docstring indent script.

In addition to passing pep8 <file> I'd like to have our files pass pylint --reports=n without any warnings or errors.

@kleyow
Copy link
Contributor Author

kleyow commented Sep 29, 2014

@dhermes Go ahead and do it with your script. Yep sounds good.

@dhermes
Copy link
Contributor

dhermes commented Sep 29, 2014

@kleyow Since you've already done a bulk of the work, let's check this in and then I can tackle the rest with the automated tools.

You can ignore the two files left out: gcloud/storage/demo/__init__.py and gcloud/datastore/connection.py but can you try to resolve the issues in existing files?

@tseaver Does this sound good?

@kleyow kleyow closed this Sep 29, 2014
@kleyow kleyow reopened this Sep 29, 2014
@kleyow
Copy link
Contributor Author

kleyow commented Sep 29, 2014

Whoops misclicked, issues were fixed in kleyow@b8a989f

@kleyow
Copy link
Contributor Author

kleyow commented Sep 29, 2014

Should I switch to

 headers = {
         'Content-Type': 'application/x-protobuf',
         'Content-Length': str(len(data)),
     }

in this ticket.

@dhermes
Copy link
Contributor

dhermes commented Sep 29, 2014

Yes please do. Also run pep8 --ignore=E111 on each of the files to make sure they have no issues.

@kleyow kleyow force-pushed the pe8_pyflakes branch 3 times, most recently from 5efa5f1 to f4fc666 Compare September 30, 2014 22:29
parthea added a commit that referenced this pull request Jun 4, 2023
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this pull request Jun 4, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [2.7.2](https://www.github.com/googleapis/python-secret-manager/compare/v2.7.1...v2.7.2) (2021-09-24)


### Bug Fixes

* add 'dict' annotation type to 'request' ([b5e0c81](https://www.github.com/googleapis/python-secret-manager/commit/b5e0c818eeca22cae59406693f435595d2b92f8d))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
parthea pushed a commit that referenced this pull request Aug 15, 2023
Source-Link: https://github.com/googleapis/synthtool/commit/0ddbff8012e47cde4462fe3f9feab01fbc4cdfd6
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bced5ca77c4dda0fd2f5d845d4035fc3c5d3d6b81f245246a36aee114970082b
parthea pushed a commit that referenced this pull request Aug 15, 2023
Source-Link: googleapis/synthtool@694118b
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ec49167c606648a063d1222220b48119c912562849a0528f35bfb592a9f72737

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Sep 14, 2023
Source-Link: googleapis/synthtool@56da63e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Sep 20, 2023
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* revert

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this pull request Sep 22, 2023
Source-Link: googleapis/synthtool@facee4c
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Sep 22, 2023
parthea pushed a commit that referenced this pull request Sep 22, 2023
Source-Link: googleapis/synthtool@571ee2c
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:660abdf857d3ab9aabcd967c163c70e657fcc5653595c709263af5f3fa23ef67
parthea pushed a commit that referenced this pull request Sep 22, 2023
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:58c7342b0bccf85028100adaa3d856cb4a871c22ca9c01960d996e66c40548ce
parthea pushed a commit that referenced this pull request Sep 22, 2023
Source-Link: googleapis/synthtool@ca87909
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:6162c384d685c5fe22521d3f37f6fc732bf99a085f6d47b677dbcae97fc21392
parthea added a commit that referenced this pull request Sep 22, 2023
parthea pushed a commit that referenced this pull request Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Oct 21, 2023
* chore(deps): update dependency google-cloud-storage to v2.1.0

* add pin for google-cloud-storage for py3.6

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this pull request Oct 21, 2023
)

Source-Link: https://github.com/googleapis/synthtool/commit/0c7b0333f44b2b7075447f43a121a12d15a7b76a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:08e34975760f002746b1d8c86fdc90660be45945ee6d9db914d1508acdf9a547
parthea pushed a commit that referenced this pull request Oct 21, 2023
- [ ] Regenerate this pull request now.

docs: list oneofs in docstring
fix(deps): require google-api-core >= 1.28.0
fix(deps): drop packaging dependency

committer: busunkim96@
PiperOrigin-RevId: 406468269

Source-Link: googleapis/googleapis@83d81b0

Source-Link: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
parthea pushed a commit that referenced this pull request Oct 21, 2023
adding label example when writing a timeseries in python

Remaking this due to the commit lint failure in #200 and it being easier to just make a new PR.  Closing #200. 

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [✔️] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-monitoring/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [✔️ for linter, unable to run the nox tests because of issues unrelated] Ensure the tests and linter pass
- [✔️] Code coverage does not decrease (if any source code was changed)
- [✔️, no doc updates required ] Appropriate docs were updated (if necessary)

Fixes #200  🦕
parthea pushed a commit that referenced this pull request Oct 21, 2023
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [backoff](https://github.com/litl/backoff) | `==1.11.0` -> `==1.11.1` | [![age](https://badges.renovateapi.com/packages/pypi/backoff/1.11.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/backoff/1.11.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/backoff/1.11.1/compatibility-slim/1.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/backoff/1.11.1/confidence-slim/1.11.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>litl/backoff</summary>

### [`v1.11.1`](https://github.com/litl/backoff/blob/master/CHANGELOG.md#v1111-2021-07-14)

[Compare Source](https://github.com/litl/backoff/compare/v1.11.0...v1.11.1)

##### Changed

-   Update **version** in backoff module

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-translate).
parthea pushed a commit that referenced this pull request Oct 21, 2023
…versions (#200)

Expand pins on library dependencies in preparation for these dependencies taking a new major version. See #10566.
parthea pushed a commit that referenced this pull request Oct 21, 2023
* chore: Update gapic-generator-python to v1.8.2

PiperOrigin-RevId: 504289125

Source-Link: googleapis/googleapis@38a48a4

Source-Link: googleapis/googleapis-gen@b2dc226
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjJkYzIyNjYzZGJlNDdhOTcyYzhkOGMyZjhhNGRmMDEzZGFmZGNiYyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Oct 21, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [3.7.1](https://www.github.com/googleapis/python-cloudbuild/compare/v3.7.0...v3.7.1) (2021-11-05)


### Bug Fixes

* **deps:** require google-api-core >= 1.28.0, drop packaging dep ([f3fb436](https://www.github.com/googleapis/python-cloudbuild/commit/f3fb4367ba598506d4cdd296870b61a8ffad75ef))


### Documentation

* list oneofs in docstring ([f3fb436](https://www.github.com/googleapis/python-cloudbuild/commit/f3fb4367ba598506d4cdd296870b61a8ffad75ef))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
parthea pushed a commit that referenced this pull request Oct 22, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Oct 31, 2023
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 459095142

Source-Link: googleapis/googleapis@4f1be99

Source-Link: googleapis/googleapis-gen@ae686d9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU2ODZkOWNkZTRmYzNlMzZkMGFjMDJlZmI4NjQzYjE1ODkwYzFlZCJ9

feat: add audience parameter
PiperOrigin-RevId: 456827138

Source-Link: googleapis/googleapis@23f1a15

Source-Link: googleapis/googleapis-gen@4075a85
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants