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 zipimport | |
# Used to try and prevent bugs from people who see that Wheels | |
# support being added to sys.path and expect that your library/tool should | |
# support this misfeature. | |
try: | |
if isinstance(__loader__, zipimport.zipimporter): | |
raise RuntimeError( | |
"Zipped imports are not supported, use something less terrible." | |
) |
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
dig mx stufft.io | |
; <<>> DiG 9.8.3-P1 <<>> mx stufft.io | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53355 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;stufft.io. IN MX |
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
pip | |
--- | |
.. contents:: | |
Usage | |
***** | |
:: |
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
. | |
├── dtest | |
│ ├── __init__.py | |
│ └── data.file | |
└── setup.py |
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
--allow-unverified PIL | |
--allow-unverified bar | |
PIL==1.0 | |
foo=2.0 # Implicitly depends on bar, which requires an unverified |
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
[distutils] | |
index-servers = | |
pypi | |
testpypi | |
[pypi] | |
username:dstufft | |
password:notmypassword | |
[testpypi] |
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 Foo(dict): | |
... def keys(self): | |
... raise NotImplementedError() | |
... | |
>>> print(**Foo()) | |
>>> Foo().keys() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "<stdin>", line 3, in keys |
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
# Option 1 | |
filename = None | |
try: | |
fileobj = tempfile.NamedTemporaryFile(delete=False) | |
filename = fileobj.name | |
fileobj.close() # Required because not all platforms can reopen a file a second time | |
with open(filename, "w") as fp: | |
fp.write(pkgutil.get_data("something.txt")) | |
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
>>> def __one__(self): | |
... pass | |
... | |
>>> class Foo: | |
... __two__ = __one__ | |
... def __three__(self): | |
... pass | |
... | |
>>> Foo.__four__ = __one__ | |
>>> obj = Foo() |
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
## Option 1 | |
# warehouse/packaging/db.py | |
class Database: | |
def query_that_thing(self): | |
pass | |
# warehouse/accounts/db.py | |
class Database: | |
def query_that_other_thing(self): | |
pass | |
# warehouse/application.py |
OlderNewer