Skip to content

Instantly share code, notes, and snippets.

Avatar

prescod

  • Ayogo Health Inc.
View GitHub Profile
View Fastnumber build failure on Heroku
Building wheel for fastnumbers (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u6un7_3p/fastnumbers/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u6un7_3p/fastnumbers/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-yjvat2p7 --python-tag cp38
cwd: /tmp/pip-install-u6un7_3p/fastnumbers/
Complete output (17 lines):
running bdist_wheel
running build
running build_ext
building 'fastnumbers' extension
creating build
View Python 3 changed literal_eval
$ python
Python 3.6.8 (default, Feb 19 2019, 17:13:58)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.10.44.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ast import literal_eval
>>> literal_eval("100-20")
80
>>>
$ pyenv shell 3.8.0
View NativeTemplate in Jinja2-2.10.3 in Python 3.6
$ pyenv shell 3.6.8
$ pip install jinja2
Collecting jinja2
Using cached https://files.pythonhosted.org/packages/65/e0/eb35e762802015cab1ccee04e8a277b03f1d8e53da3ec3106882ec42558b/Jinja2-2.10.3-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2)
Downloading https://files.pythonhosted.org/packages/f0/00/a6aea33f5598b080b86d6b6d1214b51afe3ffa6100b902d5aa465080083f/MarkupSafe-1.1.1-cp36-cp36m-macosx_10_6_intel.whl
Installing collected packages: MarkupSafe, jinja2
Successfully installed MarkupSafe-1.1.1 jinja2-2.10.3
You are using pip version 18.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
View pytest-django-calls-block-second-time
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/main.py", line 187, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/config/__init__.py", line 720, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/hooks.py", line 308, in call_historic
INTERNALERROR> res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
View Pytest-django-calls-block-first-time
File "/Users/pprescod/code/envs/metaci-py/bin/pytest", line 10, in <module>
sys.exit(main())
File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/config/__init__.py", line 71, in main
config = _prepareconfig(args, plugins)
File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/config/__init__.py", line 221, in _prepareconfig
pluginmanager=pluginmanager, args=args
File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
View INTERNALERROR-Database access not allowed Traceback
================================================================================================================================== test session starts ==================================================================================================================================
platform darwin -- Python 3.7.4, pytest-5.2.0, py-1.8.0, pluggy-0.13.0
Django settings: config.settings.test (from ini file)
rootdir: /Users/pprescod/code/MetaCI, inifile: pytest.ini
plugins: django-3.5.1, factoryboy-2.0.3, tap-2.3, django-test-plus-1.3.1
collected 84 items
metaci/build/tests/test_models.py
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/main.py", line 191, in w
View VSCode Debugging Configuration for CumulusCI
{
"name": "Python: CCI",
"type": "python",
"request": "launch",
"program": "/path/to/virtualenv/bin/cci",
"console": "integratedTerminal",
"pythonPath": "/path/to/virtualenv/bin/python",
"args": ["task", "run", "robot",
"-o", "suites", "./cumulusci/robotframework/tests/salesforce/api.robot"]
}
@prescod
prescod / Datepicker.js
Created Mar 26, 2019
Datepicker issues.
View Datepicker.js
/* eslint-disable no-console, react/prop-types */
import React, { Component, useState } from 'react';
import logo from './logo.svg';
import './App.css';
import {IconSettings, Datepicker, Button} from '@salesforce/design-system-react';
class Example extends React.Component {
static displayName = 'DatepickerExample';
constructor(props) {
@prescod
prescod / Type signature
Created Mar 25, 2019
Type signature from Flow and React
View Type signature
{|+AbstractComponent: type AbstractComponent<-Config, +Instance = mixed> = React$AbstractComponent<Config, Instance>, +Children: {+count: (children: ChildrenArray<any>) => number, +forEach: <T>(children: ChildrenArray<T>, fn: (child: T, index: number) => mixed, thisArg?: mixed) => void, +map: <T, U>(children: ChildrenArray<T>, fn: (child: $NonMaybeType<T>, index: number) => U, thisArg?: mixed) => Array<$NonMaybeType<U>>, +only: <T>(children: ChildrenArray<T>) => $NonMaybeType<T>, +toArray: <T>(children: ChildrenArray<T>) => Array<$NonMaybeType<T>>}, +ChildrenArray: type ChildrenArray<+T> = $ReadOnlyArray<ChildrenArray<T>> | T, +Component: class React$Component<Props, State = void>, +ComponentType: type ComponentType<-P> = React$ComponentType<P>, +ConcurrentMode: ({children: ?React$Node}) => React$Node, +Config: type Config<Props, DefaultProps> = React$Config<Props, DefaultProps>, +Context: type Context<T> = React$Context<T>, +DOM: any, +Element: type Element<+C> = React$Element<C>, +ElementConfig: type Elemen
@prescod
prescod / MissingFilters.py
Created Mar 14, 2019
Weird filter attribute missing bug
View MissingFilters.py
import django_filters
class Xyzzy:
myfilter = django_filters.rest_framework.ChoiceFilter()
print(myfilter)
print(Xyzzy.myfilter)
class Xyzzy(django_filters.rest_framework.FilterSet):
myfilter = django_filters.rest_framework.ChoiceFilter()
You can’t perform that action at this time.