Skip to content

Commit

Permalink
Require Python 3.6+ and misc. repo maintenance (#9)
Browse files Browse the repository at this point in the history
* Update dev dependency versions

* Switch to CircleCI

* Update setup.py for python 3.6+

* Convert README from rst to markdown

* No need for Python 2+3 cross compatible code anymore

* Style conforming to black/white

* Add notes for development and contribution

* Version CONTRIBUTING.md for real

* A more robust .gitignore

* Update changelog
  • Loading branch information
jacksonllee authored Sep 11, 2019
1 parent 7dc4db3 commit 15453a7
Show file tree
Hide file tree
Showing 23 changed files with 1,884 additions and 1,382 deletions.
54 changes: 54 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: 2

workflows:
version: 2
test:
jobs:
- build-python-3.6
- build-python-3.7
- build-python-3.8

jobs:
build-python-3.6: &template
docker:
- image: python:3.6
steps:
- checkout
- run:
name: Build source distribution and install package from it
working_directory: ~/project/
# Test that we can build a source distribution that can correctly
# install from clean slate.
# "python setup.py sdist" creates dist/pylangacq-x.y.z.tar.gz
command: |
pip install --progress-bar off --upgrade pip setuptools
python setup.py sdist
pip install dist/`ls dist/ | grep .tar.gz`
- run:
name: Install the full development requirements
working_directory: ~/project/
command: pip install --progress-bar off -r requirements.txt
- run:
name: Show installed Python packages
command: pip list
- run:
name: Run linter
working_directory: ~/
# Avoid being able to do relative imports.
# Test code by importing the *installed* library in site-packages.
command: flake8 project/setup.py project/pylangacq
- run:
name: Run python tests
working_directory: ~/
# Avoid being able to do relative imports.
# Test code by importing the *installed* library in site-packages.
command: pytest -vv --cov=project/pylangacq project/pylangacq
build-python-3.7:
<<: *template
docker:
- image: python:3.7
build-python-3.8:
<<: *template
docker:
# TODO: Switch to python:3.8 after Python 3.8 is out in Oct/Nov 2019.
- image: python:3.8-rc
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
*.egg-info/
.pytest_cache/
dist/

docs/_sources/*

# Test data
Brown/*
brown.zip
brown.zip
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]

### Added
* Support Python 3.7; turn on Travis CI builds for this Python version. (#7)
* Started testing Python 3.7 and 3.8 on continuous integration. (#9)
* Add time marker support (available at `_SingleReader`),
originally contributed at #3 by @hellolzc. (#8)

### Changed
* Remove conversational quotes in utterance processing; updated test CHAT file
* Switched from Travis CI to CircleCI for autobuilds. (#9)
* Switched README from reStructuredText to Markdown. (#9)
* Removed conversational quotes in utterance processing; updated test CHAT file
to match the latest CHILDES data. (#7)

### Deprecated
* Python < 3.5. If used, `DeprecationWarning` is raised during
installation. (#7)

### Removed
* Dropped support for Python 2.7, 3.4, and 3.5.
All code related to Python 2+3 cross compatibility was removed. (#9)

### Fixed
### Security

Expand Down
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributing

Thank you for your interest in contributing to the `pylangacq` codebase!

This page assumes that you have already created a fork of the `pylangacq` repo
under your GitHub account and have the codebase available locally for
development work. If you have followed
[these steps](https://github.com/jacksonllee/pylangacq#development),
then you are all set.

## Working on a Feature or Bug Fix

The development steps below assumes that your local Git repo has a remote
`upstream` link to `jacksonllee/pylangacq`:

```bash
git remote add upstream https://github.com/jacksonllee/pylangacq.git
```

After this step (which you only have to do once),
running `git remote -v` should show your local Git repo
has links to both "origin" (pointing to your fork `<your-github-username>/pylangacq`)
and "upstream" (pointing to `jacksonllee/pylangacq`).

To work on a feature or bug fix, here are the development steps:

1. Before doing any work, check out the master branch and
make sure that your local master branch is up-to-date with upstream master:

```bash
git checkout master
git pull upstream master
```

2. Create a new branch. This branch is where you will make commits of your work.
(As best practice, never make commits while on a master branch.
Running `git branch` tells you which branch you are on.)

```bash
git checkout -b new-branch-name
```

3. Make as many commits as needed for your work.

4. When you feel your work is ready for a pull request,
push your branch to your fork.

```bash
git push origin new-branch-name
```

5. Go to your fork `https://github.com/<your-github-username>/pylangacq` and
create a pull request off of your branch against the `jacksonllee/pylangacq` repo.

## Running Tests

The `pylangacq` repo has continuous integration (CI) turned on,
with autobuilds running pytest and flake8 for the test suite
(in the [`pylangacq/tests/`](pylangacq/tests) directory)
and code style checks, respectively.
If an autobuild at a pending pull request fails because of pytest or flake8
errors, then the errors must be fixed by further commits pushed to the branch
by the author.

If you would like to help avoid wasting free Internet resources
(every push triggers new CI autobuilds),
you can run pytest and flake8 checks locally before pushing commits:

```bash
flake8 setup.py pylangacq
pytest -vv --cov=pylangacq pylangacq
```
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

92 changes: 92 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# PyLangAcq

[![PyPI version](https://badge.fury.io/py/pylangacq.svg)](https://pypi.org/project/pylangacq)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/pylangacq.svg)](https://pypi.org/project/pylangacq)
[![CircleCI](https://circleci.com/gh/jacksonllee/pylangacq/tree/master.svg?style=svg)](https://circleci.com/gh/jacksonllee/pylangacq/tree/master)

PyLangAcq is a Python library for language acquisition research.
It allows flexible handling of the CHILDES data.

Full documentation: http://pylangacq.org/

## Features

- Comprehensive capabilities of handling CHAT transcripts as used in CHILDES
- Intuitive data structures for flexible data access and all sorts of modeling work
- Standard developmental measures such as TTR, MLU, and IPSyn readily available
- More benefits from Python: fast coding, numerous libraries
for computational modeling and machine learning
- Powerful extensions for research with conversational data in general

## Download and install

PyLangAcq is available via `pip`:

```bash
pip install -U pylangacq
```

PyLangAcq works with Python 3.6 or above.

## Development

The source code of PyLangAcq is hosted on GitHub at
https://github.com/jacksonllee/pylangacq,
where development also happens.

For the latest changes not yet released through `pip` or working on the codebase
yourself, you may obtain the latest source code through GitHub and `git`:

1. Create a fork of the `pylangacq` repo under your GitHub account.
2. Locally, make sure you are in some sort of a virtual environment
(venv, virtualenv, conda, etc).
3. Download and install the library in the "editable" mode
together with the core and dev dependencies within the virtual environment:

```bash
git clone https://github.com/<your-github-username>/pylangacq.git
cd pylangacq
pip install --upgrade pip setuptools
pip install -r requirements.txt
pip install -e .
```

We keep track of notable changes in
[CHANGELOG.md](https://github.com/jacksonllee/pylangacq/blob/master/CHANGELOG.md).

## Contribution

For questions, bug reports, and feature requests,
please [file an issue](https://github.com/jacksonllee/pylangacq/issues).

If you would like to contribute to the `pylangacq` codebase,
please see
[CONTRIBUTING.md](https://github.com/jacksonllee/pylangacq/blob/master/CONTRIBUTING.md).

## How to Cite

PyLangAcq is maintained by [Jackson Lee](http://jacksonllee.com/).
If you use PyLangAcq in your research, please cite the following:

Lee, Jackson L., Ross Burkholder, Gallagher B. Flinn, and Emily R. Coppess. 2016.
[Working with CHAT transcripts in Python](http://jacksonllee.com/papers/lee-etal-2016-pylangacq.pdf).
Technical report [TR-2016-02](http://www.cs.uchicago.edu/research/publications/techreports/TR-2016-02),
Department of Computer Science, University of Chicago.

```bibtex
@TechReport{lee-et-al-pylangacq:2016,
Title = {Working with CHAT transcripts in Python},
Author = {Lee, Jackson L. and Burkholder, Ross and Flinn, Gallagher B. and Coppess, Emily R.},
Institution = {Department of Computer Science, University of Chicago},
Year = {2016},
Number = {TR-2016-02},
}
```

## License

The MIT License; please see [LICENSE.txt](https://github.com/jacksonllee/pylangacq/blob/master/LICENSE.txt).
The test data files included
have a [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/)
license instead; please also see
[`pylangacq/tests/test_data/README.md`](https://github.com/jacksonllee/pylangacq/blob/master/pylangacq/tests/test_data/README.md).
82 changes: 0 additions & 82 deletions README.rst

This file was deleted.

13 changes: 0 additions & 13 deletions dev-requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions pylangacq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pylangacq.chat import read_chat, Reader
from pylangacq._version import __version__ # noqa
from pylangacq._version import __version__


__all__ = ['read_chat', 'Reader']
__all__ = ["__version__", "read_chat", "Reader"]
2 changes: 1 addition & 1 deletion pylangacq/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# this script is executed by setup.py
__version__ = '0.10.0'
__version__ = "0.10.0"
Loading

0 comments on commit 15453a7

Please sign in to comment.