Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

218
Vistas
After Cythonization Schemas are Gone in FastAPI Docs and Calls are not Working

I cythonized my project folder and removed all files except .so and .sh files. I was able to deploy it and it was up and running, but in docs schema information is gone and I'm not able to send information from docs into database as I had done previously. I got 500 error when I attempted to make POST calls with the data that was working before cythonization. What might be the reason?

enter image description here

My cythonization code:

import os
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import shutil
extensions = []

for root, directory, files in os.walk('./api'):
    if 'alembic' not in root:
        for file in files: 
            if file.endswith('.py') and\
                'keycloak' not in file:
                module_name = os.path.join(root[2:], file)
                package_name = root[2:].replace('/', '.')
                print(package_name, ' ', module_name)
                extensions.append(Extension(package_name, [module_name]))

setup(
    name='Indexer',
    cmdclass={'build_ext':build_ext},
    ext_modules=cythonize(extensions,
    compiler_directives={
        'c_string_type': 'str',
        'c_string_encoding': 'utf8',
        'language_level': 3})
)

def delete_files():
    for root, directory, files in os.walk('./'):
        if 'alembic' not in root:
            for file in files: 
                if not file.endswith('.so') and\
                not file.endswith('.sh') :
                    module_name = os.path.join(root, file)
                    os.remove(module_name)

def delete_directories():
    for root, directory, files in os.walk('./'):
        if root != './':
            shutil.rmtree(root)

def move_files():
    for root, directory, files in os.walk('./api'):
        if 'alembic' not in root:
            for file in files: 
                if file.endswith('.so'):
                    module_name = os.path.join(root, file)
                    shutil.move(module_name, file)

move_files()
delete_files()
delete_directories()
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda