Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!