Giter VIP home page Giter VIP logo

pysg's People

Contributors

alonblade avatar becheran avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

alonblade rhulha

pysg's Issues

setup.py does not install shaders

Describe the bug
Running setup.py results in a broken installation that is missing simple.vert & simple.frag

To Reproduce
Steps to reproduce the behavior:
2. virtualenv -p python3 venv
3. . venv/bin/activate
4. pip install pysg
5. cat <test.py
from pysg.scene import Scene
from pysg.renderer import HeadlessGLRenderer
from pysg.camera import PerspectiveCamera
scene = Scene(background_color=(1, 1, 1), ambient_light=(0.2, 0.2, 0.2))
camera = PerspectiveCamera(fov=10, aspect=1, near=1, far=10)
renderer = HeadlessGLRenderer(scene, camera, width=800, height=600)
EOF
5. python test.py
6. See error:
Traceback (most recent call last):
File "test.py", line 6, in
renderer = HeadlessGLRenderer(scene, camera, width=800, height=600)
File "/home/alon/bugreports/pysg/missing_shaders_in_setup/venv/lib/python3.8/site-packages/pysg/renderer.py", line 162, in init
super()._setup()
File "/home/alon/bugreports/pysg/missing_shaders_in_setup/venv/lib/python3.8/site-packages/pysg/renderer.py", line 57, in _setup
vertex_shader=open(os.path.join(shader_path, 'simple.vert')).read(),
FileNotFoundError: [Errno 2] No such file or directory: '/home/alon/bugreports/pysg/missing_shaders_in_setup/venv/lib/python3.8/site-packages/pysg/shader/simple.vert'

Expected behavior
No error message

Desktop (please complete the following information):

  • OS: Linux (Ubuntu 20.04), Python 3.8.5
  • pysg 0.1.3 (python -c 'import pysg; print(pysg.version)')

The following patch (I'll make a PR shortly) fixes the problem:

diff --git a/setup.py b/setup.py
index 82f111b..f7eba20 100644
--- a/setup.py
+++ b/setup.py
@@ -31,5 +31,9 @@ setuptools.setup(
         "License :: OSI Approved :: MIT License",
         "Operating System :: OS Independent",
     ],
-    zip_safe=False
+    zip_safe=False,
+    include_package_data=True,
+    package_data={
+        "pysg": ["shader/*"],
+    },
 )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.