Changes

Jump to navigation Jump to search
2,354 bytes added ,  07:19, 29 May 2017
no edit summary
Line 718: Line 718:  
== nose debug ==
 
== nose debug ==
 
  nosetests --debug=nose,nose.importer --debug-log=nose_debug <your usual args>
 
  nosetests --debug=nose,nose.importer --debug-log=nose_debug <your usual args>
 +
 +
== Publish Python Package ==
 +
This would make your package available with:
 +
pip install mypackage
 +
 +
<nowiki>see: https://packaging.python.org/distributing/
 +
# TODO: Check pbr package
 +
 +
 +
[~/pypirc]
 +
[distutils]
 +
index-servers =
 +
  pypi
 +
  pypitest
 +
 +
[pypi]
 +
repository=https://pypi.python.org/pypi
 +
username=your_username
 +
password=your_password
 +
 +
[pypitest]
 +
repository=https://testpypi.python.org/pypi
 +
username=your_username
 +
password=your_password
 +
 +
 +
$ chmod 600 ~/.pypirc
 +
 +
 +
[setup.py]
 +
 +
from distutils.core import setup
 +
setup(
 +
  name = 'mypackage',
 +
  packages = ['mypackage'], # this must be the same as the name above
 +
  version = '0.1',
 +
  description = 'A random test lib',
 +
  author = 'Peter Downs',
 +
  author_email = 'peterldowns@gmail.com',
 +
  url = 'https://github.com/peterldowns/mypackage', # use the URL to the github repo
 +
  download_url = 'https://github.com/peterldowns/mypackage/tarball/0.1', # I'll explain this in a second
 +
  keywords = ['testing', 'logging', 'example'], # arbitrary keywords
 +
  classifiers = [],
 +
)
 +
 +
[setup.cfg]
 +
[metadata]
 +
description-file = README.md
 +
 +
[LICENSE.txt]
 +
The MIT License
 +
 +
SPDX short identifier: MIT
 +
 +
Copyright <YEAR> <COPYRIGHT HOLDER>
 +
 +
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 +
 +
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 +
 +
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 +
 +
 +
 +
$ python setup.py register -r pypitest
 +
$ python setup.py sdist upload -r pypitest
 +
$ python setup.py register -r pypi
 +
$ python setup.py sdist upload -r pypi
 +
</nowiki>

Navigation menu