GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Packaging: "Guard" calls to `setuptools.setup()` behind `if __name__ == '__main__'` · Issue #4295 · googleapis/google-cloud-python

Packaging: "Guard" calls to setuptools.setup() behind if __name__ == '__main__' #4295

New issue
Copy link
New issue
Copy link
Closed
Closed
Packaging: "Guard" calls to setuptools.setup() behind if __name__ == '__main__'#4295
Copy link
Assignees
theacodes
Labels
packagingtype: cleanupAn internal cleanup or hygiene concern.

Description

@dhermes
dhermes
opened on Oct 31, 2017
Issue body actions

This way our setup.py files could be imported (for example).

This is low-priority, but an easy change to make.

Activity

  1. dhermes
    added
    hygiene
    packaging
    on Oct 31, 2017
  2. tseaver commented on Nov 1, 2017

    @tseaver
    tseaver
    on Nov 1, 2017
    Contributor
    More actions

    I'm a pretty big -1 on the idea that setup.py should ever be importable.

  3. dhermes commented on Nov 1, 2017

    @dhermes
    dhermes
    on Nov 1, 2017
    ContributorAuthor
    More actions

    @tseaver I don't actually mind if it's import-able, but that was just an example. It's more just like good hygiene to have if __name__ == '__main__' in all scripts.

  4. duggelz commented on Nov 1, 2017

    @duggelz
    duggelz
    on Nov 1, 2017
    More actions

    +1 on __main__ hygiene across the board.

  5. tseaver
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Nov 2, 2017
  6. chemelnucfin
    changed the title [-]"Guard" calls to `setuptools.setup()` behind `if __name__ == '__main__'`[/-] [+]Packaging: "Guard" calls to `setuptools.setup()` behind `if __name__ == '__main__'`[/+] on Nov 3, 2017
  7. lukesneeringer
    added
    type: cleanupAn internal cleanup or hygiene concern.
    and removed
    hygiene
    on Nov 8, 2017
  8. tseaver
    removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Jan 8, 2018
  9. chemelnucfin
    self-assigned this
    on Jan 15, 2018
  10. theacodes
    closed this as completedon Feb 2, 2018
  11. theacodes commented on Feb 2, 2018

    @theacodes
    theacodes
    on Feb 2, 2018
    Contributor
    More actions

    setup.py, like nox.py, is a configuration file for a specific tool. We should not treat it as a Python module.

  12. theacodes
    unassigned
    chemelnucfin
    on Sep 28, 2018
  13. JustinBeckwith
    assigned
    theacodes
    on Feb 1, 2021
  14. parthea
    added a commit that references this issue on Sep 22, 2023

    chore: move samples from python-docs-sample (#33)

    69c4425
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @theacodes
    theacodes

Labels

packagingtype: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.