-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require Python 3.6+ and misc. repo maintenance (#9)
* 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
1 parent
7dc4db3
commit 15453a7
Showing
23 changed files
with
1,884 additions
and
1,382 deletions.
There are no files selected for viewing
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
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 |
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
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 |
This file was deleted.
Oops, something went wrong.
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
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
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 | ||
``` |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# PyLangAcq | ||
|
||
[](https://pypi.org/project/pylangacq) | ||
[](https://pypi.org/project/pylangacq) | ||
[](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). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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"] |
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
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" |
Oops, something went wrong.