Skip to content

Commit 3e05e5b

Browse files
committed
cleaning up project, adding tests for django 1.11/2.
1 parent e935c20 commit 3e05e5b

37 files changed

+1028
-560
lines changed

.coverage

3.57 KB
Binary file not shown.

.coveragerc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[run]
2+
branch = true
3+
4+
[report]
5+
omit =
6+
*site-packages*
7+
*tests*
8+
*.tox*
9+
show_missing = True
10+
exclude_lines =
11+
raise NotImplementedError

.editorconfig

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{py,rst,ini}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.{html,css,scss,json,yml}]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
[Makefile]
23+
indent_style = tab

.gitignore

+45-23
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
1-
.idea/*
2-
.installed.cfg
3-
eggs/*
4-
bin/*
5-
build/*
6-
dist/*
7-
develop-eggs/*
8-
parts/*
9-
downloads/*
10-
11-
#egg's specific
1+
*.py[cod]
2+
__pycache__
3+
4+
# C extensions
5+
*.so
6+
7+
# Packages
8+
*.egg
129
*.egg-info
10+
dist
11+
build
12+
eggs
13+
parts
14+
bin
15+
var
16+
sdist
17+
develop-eggs
18+
.installed.cfg
19+
lib
20+
lib64
1321

14-
#defaults
15-
*.pyc
16-
*.pyo
22+
# Installer logs
23+
pip-log.txt
1724

18-
#temp file
19-
tempfile
20-
*.swp
25+
# Unit test / coverage reports
26+
.coverage
27+
.tox
28+
nosetests.xml
29+
htmlcov
2130

22-
_build
31+
# Translations
32+
*.mo
2333

24-
*.sqlite3
25-
.vagrant
26-
*.egg
27-
python3_venv
28-
Vagrantfile
34+
# Mr Developer
35+
.mr.developer.cfg
36+
.project
37+
.pydevproject
38+
39+
# Pycharm/Intellij
40+
.idea
41+
42+
# Complexity
43+
output/*.html
44+
output/*/index.html
45+
46+
# Sphinx
47+
docs/_build
48+
49+
# virtualenv
50+
venv

.travis.yml

+27-55
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,30 @@
1+
# Config file for automatic testing at travis-ci.org
2+
13
language: python
4+
5+
python:
6+
- "3.5"
7+
8+
env:
9+
- TOX_ENV=py35-django-18
10+
- TOX_ENV=py34-django-18
11+
- TOX_ENV=py33-django-18
12+
- TOX_ENV=py27-django-18
13+
- TOX_ENV=py35-django-19
14+
- TOX_ENV=py34-django-19
15+
- TOX_ENV=py27-django-19
16+
- TOX_ENV=py35-django-110
17+
- TOX_ENV=py34-django-110
18+
- TOX_ENV=py27-django-110
19+
220
matrix:
3-
include:
4-
# Django 1.4: Python 2.6--2.7
5-
- python: "2.7"
6-
env: DJANGO=django==1.4
7-
# Django 1.5: Python 2.7, pypy
8-
# (As of Django 1.5, Python 2.6 no longer "highly recommended",
9-
# and Python 3.2+ support was only "experimental", so skip those.)
10-
- python: "2.7"
11-
env: DJANGO=django==1.5
12-
- python: "pypy"
13-
env: DJANGO=django==1.5
14-
# Django 1.6: Python 2.7--3.3, pypy
15-
- python: "2.7"
16-
env: DJANGO=django==1.6
17-
- python: "3.3"
18-
env: DJANGO=django==1.6
19-
- python: "pypy"
20-
env: DJANGO=django==1.6
21-
# Django 1.7: Python 2.7--3.4, pypy
22-
- python: "2.7"
23-
env: DJANGO=django==1.7
24-
- python: "3.3"
25-
env: DJANGO=django==1.7
26-
- python: "3.4"
27-
env: DJANGO=django==1.7
28-
- python: "3.5"
29-
env: DJANGO=django==1.7
30-
- python: "pypy"
31-
env: DJANGO=django==1.7
32-
# Django 1.8: "Python 2.7 or above"
33-
- python: "2.7"
34-
env: DJANGO=django==1.8
35-
- python: "3.4"
36-
env: DJANGO=django==1.8
37-
- python: "3.5"
38-
env: DJANGO=django==1.8
39-
- python: "pypy"
40-
env: DJANGO=django==1.8
41-
# Django 1.9: "Python 2.7 or above"
42-
- python: "2.7"
43-
env: DJANGO=django==1.9
44-
- python: "3.4"
45-
env: DJANGO=django==1.9
46-
- python: "3.5"
47-
env: DJANGO=django==1.9
48-
- python: "pypy"
49-
env: DJANGO=django==1.9
50-
before_install:
51-
- pip install coverage codecov
52-
install:
53-
- pip install --upgrade setuptools pip
54-
- pip install -q $DJANGO
55-
- pip install .
56-
script: coverage run --source=countries_plus setup.py test
21+
fast_finish: true
22+
23+
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
24+
install: pip install -r requirements_test.txt
25+
26+
# command to run tests using coverage, e.g. python setup.py test
27+
script: tox -e $TOX_ENV
28+
5729
after_success:
58-
codecov
30+
- codecov -e TOX_ENV

AUTHORS.rst

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Development Lead
6+
----------------
7+
8+
* Andrew Cordery <[email protected]>
9+
10+
Contributors
11+
------------
12+
13+
luiscberrocal
14+
mrben

CHANGELOG.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
### Added
9+
- Improved documentation
10+
11+
### Changed
12+
- Added tests for Django 2.0
13+
- Dropped tested support for Django versions < 1.11
14+
15+
## [1.1.0] - 2016-03-14
16+
### Fixed
17+
- Fixed Geonames.org file format error
18+
19+
## [1.0.1] - 2015-06-16
20+
### Added
21+
- Improved test coverage.
22+
23+
### Changed
24+
- Loosened model restrictions
25+
26+
### Fixed
27+
- Fixed update_countries_plus command for python 3
28+
29+
## [1.0.0] - 2015-06-11
30+
### Added
31+
- Added feature to update data from geonames.org.
32+
33+
### Fixed
34+
- General code cleanup & improved test coverage.
35+
36+
## [0.3.3] - 2015-01-27
37+
### Changed
38+
- Now uses Django 1.7 data migration pattern
39+
40+
## [0.3.2] - 2015-01-10
41+
### Fixed
42+
- Corrected version number on setup.py
43+
44+
## [0.3.1] - 2015-01-09
45+
### Added
46+
- Now compatible with Python 3 thanks to luiscberrocal
47+
48+
## [0.3.0] - 2014-09-08
49+
### Added
50+
- Now compatible with Django 1.7 thanks to mrben
51+
52+
## [0.2.0] - 2014-02-13
53+
### Added
54+
- Added middleware that adds the request country to the request object.
55+
56+
## [0.1.5] - 2013-06-14
57+
### Fixed
58+
- Corrected model max_length attributes to properly match data.
59+
60+
## [0.1.0] - 2013-05-22
61+
### Added
62+
- Initial release.

CONTRIBUTING.rst

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
============
2+
Contributing
3+
============
4+
5+
Contributions are welcome, and they are greatly appreciated! Every
6+
little bit helps, and credit will always be given.
7+
8+
You can contribute in many ways:
9+
10+
Types of Contributions
11+
----------------------
12+
13+
Report Bugs
14+
~~~~~~~~~~~
15+
16+
Report bugs at https://github.com/cordery/django-countries-plus/issues.
17+
18+
If you are reporting a bug, please include:
19+
20+
* Your operating system name and version.
21+
* Any details about your local setup that might be helpful in troubleshooting.
22+
* Detailed steps to reproduce the bug.
23+
24+
Fix Bugs
25+
~~~~~~~~
26+
27+
Look through the GitHub issues for bugs. Anything tagged with "bug"
28+
is open to whoever wants to implement it.
29+
30+
Implement Features
31+
~~~~~~~~~~~~~~~~~~
32+
33+
Look through the GitHub issues for features. Anything tagged with "feature"
34+
is open to whoever wants to implement it.
35+
36+
Write Documentation
37+
~~~~~~~~~~~~~~~~~~~
38+
39+
Django Languages Plus could always use more documentation, whether as part of the
40+
official Django Languages Plus docs, in docstrings, or even on the web in blog posts,
41+
articles, and such.
42+
43+
Submit Feedback
44+
~~~~~~~~~~~~~~~
45+
46+
The best way to send feedback is to file an issue at https://github.com/cordery/django-countries-plus/issues.
47+
48+
If you are proposing a feature:
49+
50+
* Explain in detail how it would work.
51+
* Keep the scope as narrow as possible, to make it easier to implement.
52+
* Remember that this is a volunteer-driven project, and that contributions
53+
are welcome :)
54+
55+
Get Started!
56+
------------
57+
58+
Ready to contribute? Here's how to set up `django-countries-plus` for local development.
59+
60+
1. Fork the `django-countries-plus` repo on GitHub.
61+
2. Clone your fork locally::
62+
63+
$ git clone [email protected]:your_name_here/django-countries-plus.git
64+
65+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
66+
67+
$ mkvirtualenv django-countries-plus
68+
$ cd django-countries-plus/
69+
$ python setup.py develop
70+
71+
4. Create a branch for local development::
72+
73+
$ git checkout -b name-of-your-bugfix-or-feature
74+
75+
Now you can make your changes locally.
76+
77+
5. When you're done making changes, check that your changes pass flake8 and the
78+
tests, including testing other Python versions with tox::
79+
80+
$ flake8 countries_plus tests
81+
$ python setup.py test
82+
$ tox
83+
84+
To get flake8 and tox, just pip install them into your virtualenv.
85+
86+
6. Commit your changes and push your branch to GitHub::
87+
88+
$ git add .
89+
$ git commit -m "Your detailed description of your changes."
90+
$ git push origin name-of-your-bugfix-or-feature
91+
92+
7. Submit a pull request through the GitHub website.
93+
94+
Pull Request Guidelines
95+
-----------------------
96+
97+
Before you submit a pull request, check that it meets these guidelines:
98+
99+
1. The pull request should include tests.
100+
2. If the pull request adds functionality, the docs should be updated. Put
101+
your new functionality into a function with a docstring, and add the
102+
feature to the list in README.rst.
103+
3. The pull request should work for Python 2.6, 2.7, and 3.3, and for PyPy. Check
104+
https://travis-ci.org/cordery/django-countries-plus/pull_requests
105+
and make sure that the tests pass for all supported Python versions.
106+
107+
Tips
108+
----
109+
110+
To run a subset of tests::
111+
112+
$ python -m unittest tests.test_countries_plus

0 commit comments

Comments
 (0)