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

Disentangle import cycles #260

Closed
tseaver opened this issue Oct 17, 2014 · 7 comments
Closed

Disentangle import cycles #260

tseaver opened this issue Oct 17, 2014 · 7 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@tseaver
Copy link
Contributor

tseaver commented Oct 17, 2014

Some local non-testing imports are explicitly marked as related to cycles:

$ git grep -n circular
gcloud/datastore/dataset.py:125:        # This import is here to avoid circular 
gcloud/datastore/entity.py:157:        # This is here to avoid circular imports.

Others are not so marked:

gcloud/datastore/__init__.py:64:    from gcloud import credentials
gcloud/datastore/__init__.py:65:    from gcloud.datastore.connection import Connection
gcloud/datastore/dataset.py:73:        from gcloud.datastore.query import Query
gcloud/datastore/dataset.py:86:        from gcloud.datastore.entity import Entity
gcloud/datastore/dataset.py:99:        from gcloud.datastore.transaction import Transaction

gcloud/storage/__init__.py:65:    from gcloud import credentials
gcloud/storage/__init__.py:66:    from gcloud.storage.connection import Connection
gcloud/storage/iterator.py:158:        from gcloud.storage.bucket import Bucket
gcloud/storage/iterator.py:186:        from gcloud.storage.key import Key

We should refactor to fix the cycles, allowing us to normalize those imports.

@tseaver tseaver changed the title Untangle import cycles Disentangle import cycles Oct 17, 2014
@dhermes
Copy link
Contributor

dhermes commented Oct 17, 2014

I like it!

@tseaver
Copy link
Contributor Author

tseaver commented Oct 17, 2014

To prevent regressions, (re)enable pylint's 'cyclic-imports' check (disabled in #238) when we're done.

@dhermes
Copy link
Contributor

dhermes commented Oct 19, 2014

@tseaver are you working on this?

If not, I'm gonna assign myself. I suppose that should be part of our workflow anyhow, "self-assigning" when working on something.

@tseaver
Copy link
Contributor Author

tseaver commented Oct 19, 2014

Go ahead.

I think assignment (either self- or from @silvolu) is a reasonable "gateway" to avoiding duplication.

@dhermes dhermes self-assigned this Oct 19, 2014
@dhermes
Copy link
Contributor

dhermes commented Oct 20, 2014

PR #267 begins this

@tseaver
Copy link
Contributor Author

tseaver commented Oct 20, 2014

After merging #268 and #269, the last step is to drop the exclusion of 'cycle-imports' from the two pylintrc files.

@tseaver tseaver assigned tseaver and unassigned dhermes Oct 23, 2014
tseaver added a commit that referenced this issue Oct 23, 2014
…from_protobuf

Fix #260: break datastore cycles by moving 'from_protobuf' classmethods
@dhermes
Copy link
Contributor

dhermes commented Oct 23, 2014

w00t!

@jgeewax jgeewax modified the milestone: Core Stable Jan 30, 2015
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
atulep pushed a commit that referenced this issue Apr 3, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [2.9.2](https://www.github.com/googleapis/python-speech/compare/v2.9.1...v2.9.2) (2021-09-30)


### Bug Fixes

* improper types in pagers generation ([a0bac07](https://www.github.com/googleapis/python-speech/commit/a0bac07de9f4e89c41d34a47d9e35ec6fd7edac3))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
atulep pushed a commit that referenced this issue Apr 6, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [2.9.2](https://www.github.com/googleapis/python-speech/compare/v2.9.1...v2.9.2) (2021-09-30)


### Bug Fixes

* improper types in pagers generation ([a0bac07](https://www.github.com/googleapis/python-speech/commit/a0bac07de9f4e89c41d34a47d9e35ec6fd7edac3))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
atulep pushed a commit that referenced this issue Apr 6, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [2.9.2](https://www.github.com/googleapis/python-speech/compare/v2.9.1...v2.9.2) (2021-09-30)


### Bug Fixes

* improper types in pagers generation ([a0bac07](https://www.github.com/googleapis/python-speech/commit/a0bac07de9f4e89c41d34a47d9e35ec6fd7edac3))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
atulep pushed a commit that referenced this issue Apr 18, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [2.9.2](https://www.github.com/googleapis/python-speech/compare/v2.9.1...v2.9.2) (2021-09-30)


### Bug Fixes

* improper types in pagers generation ([a0bac07](https://www.github.com/googleapis/python-speech/commit/a0bac07de9f4e89c41d34a47d9e35ec6fd7edac3))
---


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 issue Jun 4, 2023
…260)

Source-Link: https://togithub.com/googleapis/synthtool/commit/b4fe62efb5114b6738ad4b13d6f654f2bf4b7cc0
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/26c7505b2f76981ec1707b851e1595c8c06e90fc
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f946c75373c2b0040e8e318c5e85d0cf46bc6e61d0a01f3ef94d8de974ac6790
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/30bd01b4ab78bf1b2a425816e15b3e7e090993dd
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:9bc5fa3b62b091f60614c08a7fb4fd1d3e1678e326f34dd66ce1eefb5dc3267b
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/5f2a6089f73abf06238fe4310f6a14d6f6d1eed3
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8555f0e37e6261408f792bfd6635102d2da5ad73f8f09bcb24f25e6afb5fac97
parthea added a commit that referenced this issue Jun 4, 2023
fix(deps): require proto-plus>=1.15.0
parthea pushed a commit that referenced this issue Jul 6, 2023
- [ ] Regenerate this pull request now.

fix: resolve DuplicateCredentialArgs error when using credentials_file

committer: parthea
PiperOrigin-RevId: 425964861

Source-Link: googleapis/googleapis@84b1a5a

Source-Link: googleapis/googleapis-gen@4fb761b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGZiNzYxYmJkODUwNmFjMTU2ZjQ5YmFjNWYxODMwNmFhOGViM2FhOCJ9

Closes #259
parthea pushed a commit that referenced this issue Aug 15, 2023
Source-Link: googleapis/synthtool@ca87909
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:6162c384d685c5fe22521d3f37f6fc732bf99a085f6d47b677dbcae97fc21392
parthea pushed a commit that referenced this issue Aug 15, 2023
* docs: Add documentation for enums

fix: Add context manager return types

chore: Update gapic-generator-python to v1.8.1
PiperOrigin-RevId: 503210727

Source-Link: googleapis/googleapis@a391fd1

Source-Link: googleapis/googleapis-gen@0080f83
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9

* 🦉 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 issue Sep 20, 2023
…260)

Source-Link: https://togithub.com/googleapis/synthtool/commit/b4fe62efb5114b6738ad4b13d6f654f2bf4b7cc0
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1
vchudnov-g pushed a commit that referenced this issue Sep 20, 2023
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* chore(java): update trademark blurb in README

Source-Author: Jeff Ching <[email protected]>
Source-Date: Wed Dec 9 15:14:01 2020 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 352f25621c28d2fa0784984ea0ed5ea697aa1525
Source-Link: googleapis/synthtool@352f256

* chore(deps): update precommit hook pre-commit/pre-commit-hooks to v3.4.0

Co-authored-by: Tres Seaver <[email protected]>

Source-Author: WhiteSource Renovate <[email protected]>
Source-Date: Wed Dec 16 18:13:24 2020 +0100
Source-Repo: googleapis/synthtool
Source-Sha: aa255b15d52b6d8950cca48cfdf58f7d27a60c8a
Source-Link: googleapis/synthtool@aa255b1

* docs(python): document adding Python 3.9 support, dropping 3.5 support

Closes #787

Source-Author: Tres Seaver <[email protected]>
Source-Date: Thu Dec 17 16:08:02 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: b670a77a454f415d247907908e8ee7943e06d718
Source-Link: googleapis/synthtool@b670a77

* chore: exclude `.nox` directories from linting

The samples tests create `.nox` directories
with all dependencies installed. These directories
should be excluded from linting.

I've tested this change locally, and it significantly
speeds up linting on my machine.

Source-Author: Tim Swast <[email protected]>
Source-Date: Tue Dec 22 13:04:04 2020 -0600
Source-Repo: googleapis/synthtool
Source-Sha: 373861061648b5fe5e0ac4f8a38b32d639ee93e4
Source-Link: googleapis/synthtool@3738610

* chore(python): fix column sizing issue in docs

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Thu Jan 7 11:58:32 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: f15b57ccfd71106c2299e9b89835fe6e55015662
Source-Link: googleapis/synthtool@f15b57c

* chore(python): use 'http' in LICENSE

Co-authored-by: Tim Swast <[email protected]>

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Thu Jan 7 13:05:12 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 41a4e56982620d3edcf110d76f4fcdfdec471ac8
Source-Link: googleapis/synthtool@41a4e56

* chore(python): skip docfx in main presubmit

* chore(python): skip docfx in main presubmit

* fix: properly template the repo name

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Fri Jan 8 10:32:13 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: fb53b6fb373b7c3edf4e55f3e8036bc6d73fa483
Source-Link: googleapis/synthtool@fb53b6f

* chore: add missing quotation mark

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Mon Jan 11 09:43:06 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 16ec872dd898d7de6e1822badfac32484b5d9031
Source-Link: googleapis/synthtool@16ec872

* build(python): make `NOX_SESSION` optional

I added this accidentally in #889. `NOX_SESSION` should be passed down if it is set but not marked required.

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Tue Jan 19 09:38:04 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: ba960d730416fe05c50547e975ce79fcee52c671
Source-Link: googleapis/synthtool@ba960d7

* chore: Add header checker config to python library synth

Now that we have it working in [python-docs-samples](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/.github/header-checker-lint.yml) we should consider adding it to the 🐍 libraries :)

Source-Author: Leah E. Cole <[email protected]>
Source-Date: Mon Jan 25 13:24:08 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 573f7655311b553a937f9123bee17bf78497db95
Source-Link: googleapis/synthtool@573f765

* chore: add noxfile parameters for extra dependencies

Also, add tests for some noxfile parameters for assurance that the
template generates valid Python.

Co-authored-by: Jeffrey Rennie <[email protected]>

Source-Author: Tim Swast <[email protected]>
Source-Date: Tue Jan 26 12:26:57 2021 -0600
Source-Repo: googleapis/synthtool
Source-Sha: 778d8beae28d6d87eb01fdc839a4b4d966ed2ebe
Source-Link: googleapis/synthtool@778d8be

* build: migrate to flakybot

Source-Author: Justin Beckwith <[email protected]>
Source-Date: Thu Jan 28 22:22:38 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: d1bb9173100f62c0cfc8f3138b62241e7f47ca6a
Source-Link: googleapis/synthtool@d1bb917

* chore(python): include py.typed files in release

A py.typed file must be included in the released package for it to be considered typed by type checkers. https://www.python.org/dev/peps/pep-0561/#packaging-type-information. See googleapis/python-secret-manager#79

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Fri Feb 5 17:32:06 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 33366574ffb9e11737b3547eb6f020ecae0536e8
Source-Link: googleapis/synthtool@3336657

* docs: update python contributing guide

Adds details about blacken, updates version for system tests,
and shows how to pass through pytest arguments.

Source-Author: Chris Cotter <[email protected]>
Source-Date: Mon Feb 8 17:13:36 2021 -0500
Source-Repo: googleapis/synthtool
Source-Sha: 4679e7e415221f03ff2a71e3ffad75b9ec41d87e
Source-Link: googleapis/synthtool@4679e7e

* build(python): enable flakybot on library unit and system tests

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Wed Feb 17 14:10:46 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: d17674372e27fb8f23013935e794aa37502071aa
Source-Link: googleapis/synthtool@d176743

* test: install pyopenssl for mtls testing

Source-Author: arithmetic1728 <[email protected]>
Source-Date: Tue Mar 2 12:27:56 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 0780323da96d5a53925fe0547757181fe76e8f1e
Source-Link: googleapis/synthtool@0780323
parthea pushed a commit that referenced this issue Sep 22, 2023
Source-Link: googleapis/synthtool@50db768
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978
parthea pushed a commit that referenced this issue Sep 22, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
…260)

Source-Link: googleapis/synthtool@95d9289
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:c8878270182edaab99f2927969d4f700c3af265accd472c3425deedff2b7fd93

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
- [ ] Regenerate this pull request now.

Source-Link: googleapis/googleapis@fd16b6a

Source-Link: googleapis/googleapis-gen@d935b98
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDkzNWI5ODQ3YTFiNzA4YWI0ZTY5NjMyMGJhNjBjZTAzNDFjNWQ3YSJ9


Source-Link: googleapis/googleapis@4bb6fd6

Source-Link: googleapis/googleapis-gen@c7d0653
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzdkMDY1MzNiZTZlMjQ3MGUzNmI5ZjM1MWFlNGZmNDc5YTQ3ZGM1MyJ9


PiperOrigin-RevId: 440970084

Source-Link: googleapis/googleapis@5e0a3d5

Source-Link: googleapis/googleapis-gen@b0c628a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9

fix(compute): replace missing REQUIRED for parent_id
feat: add new methods for long running operations
fix(deps): require google-api-core>=2.7.0
chore: Use gapic-generator-python 0.65.0
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: googleapis/synthtool@993985f
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd
parthea added a commit that referenced this issue Oct 21, 2023
* chore: use gapic-generator-python 0.58.4

fix: provide appropriate mock values for message body fields

committer: dovs
PiperOrigin-RevId: 419025932

Source-Link: googleapis/googleapis@73da669

Source-Link: googleapis/googleapis-gen@46df624
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDZkZjYyNGE1NGI5ZWQ0N2MxYTdlZWZiN2E0OTQxM2NmN2I4MmY5OCJ9

* 🦉 Updates from OwlBot

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>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea pushed a commit that referenced this issue Oct 21, 2023
parthea added a commit that referenced this issue Oct 21, 2023
parthea pushed a commit that referenced this issue Oct 21, 2023
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: googleapis/synthtool@e33d52a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3a4c28a0f907c5b4330c6787cb70a45b9713ca7715b4a6779fd079445aac4036

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 22, 2023
Source-Link: googleapis/synthtool@d52e638
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:4f9b3b106ad0beafc2c8a415e3f62c1a0cc23cabea115dbe841b848f581cfe99

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 22, 2023
* docs: Minor formatting
chore: Update gapic-generator-python to v1.11.5
build: Update rules_python to 0.24.0

PiperOrigin-RevId: 563436317

Source-Link: googleapis/googleapis@42fd37b

Source-Link: googleapis/googleapis-gen@280264c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjgwMjY0Y2EwMmZiOTMxNmI0MjM3YTk2ZDBhZjFhMjM0M2E4MWE1NiJ9

* 🦉 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 added a commit that referenced this issue Oct 22, 2023
* chore: Update gapic-generator-python to v1.8.5

PiperOrigin-RevId: 511892190

Source-Link: googleapis/googleapis@a45d9c0

Source-Link: googleapis/googleapis-gen@1907294
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTkwNzI5NGIxZDgzNjVlYTI0ZjhjNWYyZTA1OWE2NDEyNGM0ZWQzYiJ9

* 🦉 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>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea pushed a commit that referenced this issue Oct 22, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [2.9.2](https://www.github.com/googleapis/python-speech/compare/v2.9.1...v2.9.2) (2021-09-30)


### Bug Fixes

* improper types in pagers generation ([a0bac07](https://www.github.com/googleapis/python-speech/commit/a0bac07de9f4e89c41d34a47d9e35ec6fd7edac3))
---


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 issue Oct 22, 2023
Source-Link: googleapis/synthtool@703554a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:94961fdc5c9ca6d13530a6a414a49d2f607203168215d074cdb0a1df9ec31c0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants