Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py Should Check Exit Value of subprocess.run() -- e.g. parse_gen.py #258

Open
TikiBill opened this issue May 20, 2020 · 2 comments
Open

Comments

@TikiBill
Copy link

(Let me know if you'd like pull requests.)

E.g. if an incompatible version of slugify is installed, parse_gen.py can fail causing other confusing downstream compile errors. Trying to build again will not resolve the issue nor repeat the error because it looks to setup.py like parse_gen.py ran. Suggested code in setup.py around line 84:

    if not os.path.exists(cputables_path):
        completed_process = subprocess.run([sys.executable, 'libudis/cpugen.py'])
        if completed_process.returncode != 0:
            if os.path.exists(cputables_path):
                os.remove(cputables_path)
            sys.exit("libudis/cpugen.py failed, stopping the build.")

And line 97:

    if not os.path.exists(parse_gen_path):
        completed_process = subprocess.run([sys.executable, 'libudis/parse_gen.py'])
        if completed_process.returncode != 0:
            if os.path.exists(parse_gen_path):
                os.remove(parse_gen_path)
            sys.exit("libudis/parse_gen.py failed, stopping the build (make sure you have python-slugify an not slugify).")

Obviously, the issue I was having is that I installed slugify (0.0.1) rather than python-slugify (4.0.0). Perhaps also make a note in the build docs about python-slugify vs. slugify.

@robmcmullen
Copy link
Owner

Sure, pull requests would be great as I'm not sure how many more weeks it's going to take to get a windows machine up and running for me.

@TikiBill
Copy link
Author

I'm on it! I'm sure you are in no rush, regardless it'll be a few days. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants