question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

examples are added to site-packages

See original GitHub issue

When installing graphene using pip it creates an examples directory in site-packages with the star wars example schema.

I feel like it’s improper to add a base examples directory. Either it should not be added or placed inside the graphene directory.

Steps to reproduce:

Start empty pipenv project

Run pipenv install graphene

In a python file: from examples.starwars.schema import schema

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
radekwlskcommented, Mar 28, 2020

@marnixlenoble @jkimbo I’ve found that issue cause in setup.py (packages=find_packages(exclude=["tests", "tests.*", "examples"])) and I was able to fix it by changing examples to examples*.

Unfortunately there seems to be no easy way to make package examples an optional dependency when it is in the same repository. Maybe it will be a good idea to separate examples from main package and then it could be added as extras_require={"examples": ["graphene-examples"]}?

Is it even necessary to allow installation of examples or are they here only for documentation purposes?

EDIT: I am also not sure what exclude "tests" is supposed to do as all test files are currently also included in package installation.

0reactions
jkimbocommented, Apr 19, 2020

Yep this can be closed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is python's site-packages directory? - Stack Overflow
A Python installation has a site-packages directory inside the module directory. This directory is where user installed packages are dropped.
Read more >
site — Site-specific configuration hook — Python 3.11.1 ...
Importing this module will append site-specific paths to the module search path and add a few builtins, unless -S was used. In that...
Read more >
Introduction to Packaging
Abstract. This document describes the current state of packaging in Python using Distribution Utilities (“Distutils”) and its extensions from the end-user's ...
Read more >
How do I find the location of my Python site-packages directory
Hint: Running pip list --user or pip freeze --user gives you a list of all installed per user site-packages.
Read more >
4. Package structure and distribution
From the code examples above, we've added the names a (an integer), ... a site-packages/ directory, which is where Python puts installed packages...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found