Skip to content

Commit

Permalink
move build and other commands to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jdidion committed Nov 11, 2016
1 parent 7c0ce90 commit f3588cb
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 11 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include versioneer.py
include xphyle/_version.py
include README.md
include README.rst
include LICENSE
include tests/test*.py
include docs/*.rst
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
build:
python setup.py install && nose2 -C tests --coverage-report term-missing --coverage-config .coveragerc

release:
# tag
git tag $version
# build
python setup.py install
nose2 -C tests --coverage-report term-missing --coverage-config .coveragerc
python setup.py sdist bdist_wheel
# release
twine register dist/xphyle-${version}.tar.gz
twine upload dist/xphyle-${version}.tar.gz

readme:
pandoc --from=markdown --to=rst --output=README.rst README.md
84 changes: 84 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
|https://pypi.python.org/pypi/xphyle|
|https://travis-ci.org/jdidion/xphyle| |Coverage Status| |Documentation
Status|

xphyle: extraordinarily simple file handling
============================================

xphyle is a small python (3.3+) library that makes it easy to open
compressed files. Most importantly, xphyle will use the appropriate
program (e.g. 'gzip') to compress/uncompress a file if it is available
on your system; this is almost always faster than using the
corresponding python library. xphyle also provides methods that simplify
common file I/O operations.

Installation
============

From pypi::

pip install xphyle

Example usages:
===============

.. code:: python
from xphyle import *
from xphyle.paths import STDIN, STDOUT
# Open a compressed file...
myfile = xopen('infile.gz')
# ...or a compressed stream
# e.g. gzip -c afile | python my_program.py
stdin = xopen(STDIN)
# We have to tell xopen what kind of compression
# to use when writing to stdout
stdout = xopen(STDOUT, compression='gz')
# Print all lines in a compressed file...
with open_('infile.gz') as myfile:
for line in myfile:
print(line)
# ... or a compressed URL
with open_('http://foo.com/myfile.gz') as myfile:
for line in myfile:
print(line)
# Transparently handle paths and file objects
def dostuff(path_or_file):
with open_(path_or_file) as myfile:
for line in myfile:
print(line)
# Read all lines in a compressed file into a list
from xphyle.utils import safe_iter
lines = list(safe_iter('infile.gz'))
# Sum the rows in a compressed file where each line is an integer value
total = sum(safe_iter('infile.gz', convert=int))
See the
`Documentation <http://xphyle.readthedocs.io/en/latest/?badge=latest>`__
for full usage information.

Roadmap
=======

1.0
---

- User documentation

Beyond 1.0, releases will be mapped using `GitHub
Projects <https://github.com/jdidion/xphyle/projects>`__.

.. |https://pypi.python.org/pypi/xphyle| image:: https://img.shields.io/pypi/v/xphyle.svg?branch=master
.. |https://travis-ci.org/jdidion/xphyle| image:: https://travis-ci.org/jdidion/xphyle.svg?branch=master
.. |Coverage Status| image:: https://coveralls.io/repos/github/jdidion/xphyle/badge.svg?branch=master
:target: https://coveralls.io/github/jdidion/xphyle?branch=master
.. |Documentation Status| image:: https://readthedocs.org/projects/xphyle/badge/?version=latest
:target: http://xphyle.readthedocs.io/en/latest/?badge=latest
10 changes: 0 additions & 10 deletions release.sh

This file was deleted.

0 comments on commit f3588cb

Please sign in to comment.