This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.venv/bin/pypy: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory | |
New pypy executable in .venv/bin/pypy | |
ERROR: The executable .venv/bin/pypy is not functioning | |
ERROR: It thinks sys.prefix is u'/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7' (should be u'/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.venv') | |
ERROR: virtualenv is not compatible with this system or executable | |
/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.venv/bin/pypy: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def load_py_file(path): | |
if sys.version_info >= (3, 4): | |
"""???? what goes here ???? | |
load_module() is deprecated? Docs at | |
https://docs.python.org/3.4/library/importlib.html#importlib.abc.Loader.load_module | |
https://docs.python.org/3.4/library/importlib.html#importlib.abc.Loader.exec_module | |
completely unclear, what does "exec_module()" do? is that the replacement? | |
can we please stop changing the API here?""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import * | |
from sqlalchemy.orm import * | |
from sqlalchemy.ext.declarative import declarative_base | |
Base = declarative_base() | |
class A(Base): | |
__tablename__ = 'a' | |
id = Column(Integer, primary_key=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import * | |
from sqlalchemy.orm import * | |
from sqlalchemy.ext.declarative import declarative_base | |
Base = declarative_base() | |
class A(Base): | |
__tablename__ = 'a' | |
id = Column(Integer, primary_key=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- goal - any time we select FROM my_filtered_table, we want "WHERE my_filtered_table.deleted = 0" added. | |
-- here's the query: | |
SELECT * from some_table LEFT OUTER JOIN my_filtered_table ON some_table.id = my_filtered_table.some_id | |
-- great lets add WHERE: | |
SELECT * from some_table | |
LEFT OUTER JOIN my_filtered_table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node(Base): | |
__tablename__ = "node" | |
id = Column(Integer, primary_key=True) | |
path = Column(String(500), nullable=False) | |
depth = Column(Integer, nullable=False) | |
children = relationship("Node", viewonly=True, | |
primaryjoin=and_( | |
remote(foreign(path)).like(path.concat(".%")), | |
remote(depth) == depth + 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Rework pip's --download feature to only download files that absolutely | |
aren't downloaded already. | |
""" | |
import pkg_resources | |
import sys | |
import os | |
import re | |
from pip.commands import install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
classics-MacBook-Pro-2:dev classic$ tar -zxf ~/Desktop/tmp/packages/cryptography-0.4.tar.gz | |
classics-MacBook-Pro-2:dev classic$ cd cryptography-0.4/ | |
classics-MacBook-Pro-2:cryptography-0.4 classic$ python setup.py egg_info | |
Package libffi was not found in the pkg-config search path. | |
Perhaps you should add the directory containing `libffi.pc' | |
to the PKG_CONFIG_PATH environment variable | |
No package 'libffi' found | |
Package libffi was not found in the pkg-config search path. | |
Perhaps you should add the directory containing `libffi.pc' | |
to the PKG_CONFIG_PATH environment variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# as opposed to setuptools-dependent http://pytest.org/latest/goodpractises.html#integration-with-setuptools-test-commands | |
# or non-OSS and incredibly verbose http://pytest.org/latest/goodpractises.html#integrating-with-distutils-python-setup-py-test | |
# just call this "mypackage.run_disutils" and then | |
# test_suite="mypackage.run_distutils" | |
import unittest | |
import pytest | |
class TestSuite(unittest.TestCase): | |
def test_sqlalchemy(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import * | |
from sqlalchemy.orm import * | |
from sqlalchemy.ext.declarative import declarative_base | |
Base = declarative_base() | |
class MyType(TypeDecorator): | |
impl = Integer | |
def process_bind_param(self, value, dialect): |