You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having troubles generating a Prisma client during a setuptools package.
I have a Python scrapy project where I'm using the scrapyd-client (scrapyd-deploy command) to package the project into an egg that is then deployed to my target server. However, during the build process, I'm constantly getting the error:
... raise RuntimeError(\nRuntimeError: The Client hasn't been generated yet, you must run prisma generate before you can use the client.\nSee https://prisma-client-py.readthedocs.io/en/stable/reference/troubleshooting/#client-has-not-been-generated-yet\
My current approaches to solving this problem have been:
Change the output path in my prisma.schema to prisma/client.
Add the path to my package_data: include_package_data=True, package_data={ '': ['*.prisma', 'prisma/*'] }
Add the directories to a MANIFEST.in in the root of my project: include prisma/schema.prisma recursive-include prisma/client *
Try to generate the client during setup.py (not overly familiar with how this works):
from setuptools import setup, find_packages
from setuptools.command.install import install
import subprocess
class CustomInstall(install):
def run(self):
try:
# Run prisma generate
subprocess.check_call(['prisma', 'generate'])
except subprocess.CalledProcessError as e:
print("Error during Prisma client generation:", e)
raise
install.run(self)
setup(
name = 'project',
version = '1.0',
packages = find_packages(),
entry_points = {'scrapy': ['settings = scrapers.settings']},
include_package_data=True,
package_data={
'': ['*.prisma', 'prisma/client/*']
}
)
Does anyone have any experience packaging a prisma client as part of a scrapy project? Or have any pointers on how I can include the client or generate the client during build or runtime?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm having troubles generating a Prisma client during a setuptools package.
I have a Python scrapy project where I'm using the scrapyd-client (scrapyd-deploy command) to package the project into an egg that is then deployed to my target server. However, during the build process, I'm constantly getting the error:
...
raise RuntimeError(\nRuntimeError: The Client hasn't been generated yet, you must run
prisma generatebefore you can use the client.\nSee https://prisma-client-py.readthedocs.io/en/stable/reference/troubleshooting/#client-has-not-been-generated-yet\
My current approaches to solving this problem have been:
include_package_data=True, package_data={ '': ['*.prisma', 'prisma/*'] }
include prisma/schema.prisma recursive-include prisma/client *
Does anyone have any experience packaging a prisma client as part of a scrapy project? Or have any pointers on how I can include the client or generate the client during build or runtime?
Beta Was this translation helpful? Give feedback.
All reactions