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

Bad requirements for postgres based installations #142

Closed
hassonofer opened this issue Oct 2, 2016 · 8 comments
Closed

Bad requirements for postgres based installations #142

hassonofer opened this issue Oct 2, 2016 · 8 comments

Comments

@hassonofer
Copy link

hassonofer commented Oct 2, 2016

After merging #140, pip install django-silk fails for postgres based installations.

mysqlclient was added as a requirement, which produces the following error (if no mysql installation exist).

Collecting mysqlclient (from django-silk)
  Using cached mysqlclient-1.3.9.tar.gz
    Complete output from command python setup.py egg_info:
    sh: mysql_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-KYR3WJ/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 44, in get_config
        libs = mysql_config("libs_r")
      File "setup_posix.py", line 26, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    EnvironmentError: mysql_config not found
@avelis
Copy link
Collaborator

avelis commented Oct 2, 2016

@hassonofer For now, I suggest to install version 1.7.0. I will look into a SQL agnostic solution for the exception catching that can still encompass what @hanleyhansen was adding in his last PR.

@hassonofer
Copy link
Author

First of all, thank you very much for the prompt response.

I did not test it myself, but as far as I know django.db.DatabaseError or the more general django.db.Error should catch this error.
As documented here: https://github.com/django/django/blob/149ace94dfc10504a0e69462c7737f5ce05340a4/docs/releases/1.4.txt#L880

@hanleyhansen
Copy link
Member

hanleyhansen commented Oct 2, 2016

Hi @hassonofer ,

I'll be home in 30 mins and will try that. It if works I'll put another PR up. I'm sore @avelis will merge it right away so we don't hold you up.

Sorry for the inconvenience.

@hassonofer
Copy link
Author

hassonofer commented Oct 2, 2016

There is no rush at all, I updated my puppet manifests today to stay on 0.7.0 :)

@avelis
Copy link
Collaborator

avelis commented Oct 3, 2016

@hassonofer Thanks for suggesting a django.db.DatabaseError error catch instead. Sounds like the right type of error to catch. @hanleyhansen If you get a PR working I will promptly merge as well.

I will also into taking down 1.7.1 from PyPi to avoid others from getting caught into this issue.

avelis added a commit that referenced this issue Oct 5, 2016
Addresses #142

Using Django’s DatabaseError class as the exception to catch keeps the
library and this try catch database platform agnostic. That way
developers who have a Postgres or MySQL backend should mutually benefit
from this retry.
@avelis
Copy link
Collaborator

avelis commented Oct 5, 2016

@hanleyhansen I made a branch to try out a different class in the exception catching. Can you confirm/deny if that works for you?

avelis pushed a commit that referenced this issue Oct 6, 2016
Addresses #142

Using Django’s DatabaseError class as the exception to catch keeps the
library and this try catch database platform agnostic. That way
developers who have a Postgres or MySQL backend should mutually benefit
from this retry.
@avelis
Copy link
Collaborator

avelis commented Dec 3, 2016

@avelis avelis closed this as completed Dec 3, 2016
@hassonofer
Copy link
Author

I forgot to update here, it works great, thanks for everyone who helped.

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

No branches or pull requests

3 participants