Skip to content

Commit 36ae4aa

Browse files
committed
Initial commit
0 parents  commit 36ae4aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2661
-0
lines changed

.bumpversion.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[bumpversion]
2+
current_version = 0.1.0
3+
commit = True
4+
tag = True
5+
6+
[bumpversion:file:pyproject.toml]
7+
search = version = "{current_version}"
8+
replace = version = "{new_version}"
9+
10+
[bumpversion:file:location_api/__init__.py]
11+
search = __version__ = '{current_version}'
12+
replace = __version__ = '{new_version}'

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.bat]
14+
indent_style = tab
15+
end_of_line = crlf
16+
17+
[LICENSE]
18+
insert_final_newline = false
19+
20+
[Makefile]
21+
indent_style = tab

.github/ISSUE_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* Django Location API version:
2+
* Python version:
3+
* Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.
15+
```

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
python-version: ["3.12"]
14+
os: [ubuntu-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Check out repository
18+
uses: actions/checkout@v3
19+
- name: "Set up python ${{ matrix.python-version }}"
20+
id: setup-python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
#----------------------------------------------
25+
# ----- install & configure poetry -----
26+
#----------------------------------------------
27+
- name: Install Poetry
28+
uses: snok/install-poetry@v1
29+
with:
30+
virtualenvs-create: true
31+
virtualenvs-in-project: true
32+
#----------------------------------------------
33+
# load cached venv if cache exists
34+
#----------------------------------------------
35+
- name: Load cached venv
36+
id: cached-poetry-dependencies
37+
uses: actions/cache@v3
38+
with:
39+
path: .venv
40+
key: venv-${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
41+
#----------------------------------------------
42+
# install dependencies if cache does not exist
43+
#----------------------------------------------
44+
- name: Install dependencies
45+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
46+
run: poetry install --no-interaction --no-root
47+
#----------------------------------------------
48+
# install your root project, if required
49+
#----------------------------------------------
50+
- name: Install library
51+
run: poetry install --no-interaction
52+
#----------------------------------------------
53+
# Run tests
54+
#----------------------------------------------
55+
- name: Run tests
56+
run: poetry run invoke test
57+
#----------------------------------------------
58+
# Build docs
59+
#----------------------------------------------
60+
- name: Build docs
61+
run: poetry run invoke docs
62+
#----------------------------------------------
63+
# Deploy docs (if on main)
64+
#----------------------------------------------
65+
- name: Deploy docs 🚀
66+
if: github.ref == 'refs/heads/main'
67+
uses: JamesIves/github-pages-deploy-action@v4
68+
with:
69+
folder: docs/_build

.gitignore

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
58+
# Flask stuff:
59+
instance/
60+
.webassets-cache
61+
62+
# Scrapy stuff:
63+
.scrapy
64+
65+
# Sphinx documentation
66+
docs/_build/
67+
68+
# PyBuilder
69+
target/
70+
71+
# Jupyter Notebook
72+
.ipynb_checkpoints
73+
74+
# pyenv
75+
.python-version
76+
77+
# celery beat schedule file
78+
celerybeat-schedule
79+
80+
# SageMath parsed files
81+
*.sage.py
82+
83+
# dotenv
84+
.env
85+
86+
# virtualenv
87+
.venv
88+
venv/
89+
ENV/
90+
91+
# Spyder project settings
92+
.spyderproject
93+
.spyproject
94+
95+
# Rope project settings
96+
.ropeproject
97+
98+
# mkdocs documentation
99+
/site
100+
101+
# mypy
102+
.mypy_cache/
103+
104+
# IDE settings
105+
.vscode/

AUTHORS.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Development Lead
6+
----------------
7+
8+
* Carl Robben <carl@successmonkey.co.nz>
9+
10+
Contributors
11+
------------
12+
13+
None yet. Why not be the first?

CONTRIBUTING.rst

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
.. highlight:: shell
2+
3+
============
4+
Contributing
5+
============
6+
7+
Contributions are welcome, and they are greatly appreciated! Every little bit
8+
helps, and credit will always be given.
9+
10+
You can contribute in many ways:
11+
12+
Types of Contributions
13+
----------------------
14+
15+
Report Bugs
16+
~~~~~~~~~~~
17+
18+
Report bugs at https://github.com/carlosfunk/django-location-api/issues.
19+
20+
If you are reporting a bug, please include:
21+
22+
* Your operating system name and version.
23+
* Any details about your local setup that might be helpful in troubleshooting.
24+
* Detailed steps to reproduce the bug.
25+
26+
Fix Bugs
27+
~~~~~~~~
28+
29+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
30+
wanted" is open to whoever wants to implement it.
31+
32+
Implement Features
33+
~~~~~~~~~~~~~~~~~~
34+
35+
Look through the GitHub issues for features. Anything tagged with "enhancement"
36+
and "help wanted" is open to whoever wants to implement it.
37+
38+
Write Documentation
39+
~~~~~~~~~~~~~~~~~~~
40+
41+
Django Location API could always use more documentation, whether as part of the
42+
official Django Location API docs, in docstrings, or even on the web in blog posts,
43+
articles, and such.
44+
45+
Submit Feedback
46+
~~~~~~~~~~~~~~~
47+
48+
The best way to send feedback is to file an issue at https://github.com/carlosfunk/django-location-api/issues.
49+
50+
If you are proposing a feature:
51+
52+
* Explain in detail how it would work.
53+
* Keep the scope as narrow as possible, to make it easier to implement.
54+
* Remember that this is a volunteer-driven project, and that contributions
55+
are welcome :)
56+
57+
Get Started!
58+
------------
59+
60+
Ready to contribute? Here's how to set up `django-location-api` for local development.
61+
62+
#. Fork the `django-location-api` repo on GitHub.
63+
#. Clone your fork locally::
64+
65+
$ git clone git@github.com:your_name_here/django-location-api.git
66+
67+
#. Ensure `poetry is installed`_.
68+
#. Install dependencies and start your virtualenv::
69+
70+
$ poetry install
71+
72+
#. Create a branch for local development::
73+
74+
$ git checkout -b name-of-your-bugfix-or-feature
75+
76+
Now you can make your changes locally.
77+
78+
#. When you're done making changes, check that your changes pass the
79+
tests, including testing other Python versions, with tox::
80+
81+
$ tox
82+
83+
#. Commit your changes and push your branch to GitHub::
84+
85+
$ git add .
86+
$ git commit -m "Your detailed description of your changes."
87+
$ git push origin name-of-your-bugfix-or-feature
88+
89+
#. Submit a pull request through the GitHub website.
90+
91+
.. _poetry is installed: https://python-poetry.org/docs/
92+
93+
Pull Request Guidelines
94+
-----------------------
95+
96+
Before you submit a pull request, check that it meets these guidelines:
97+
98+
1. The pull request should include tests.
99+
2. If the pull request adds functionality, the docs should be updated. Put
100+
your new functionality into a function with a docstring, and add the
101+
feature to the list in README.rst.
102+
3. The pull request should work for Python 3.10, 3.11, and 3.12. Check
103+
https://travis-ci.com/carlosfunk/django-location-api/pull_requests
104+
and make sure that the tests pass for all supported Python versions.
105+
106+
Tips
107+
----
108+
109+
To run a subset of tests::
110+
111+
$ python -m unittest tests.test_django-location-api
112+
113+
Deploying
114+
---------
115+
116+
A reminder for the maintainers on how to deploy.
117+
Make sure all your changes are committed (including an entry in HISTORY.rst).
118+
Then run::
119+
120+
$ bump2version patch # possible: major / minor / patch
121+
$ git push
122+
$ git push --tags
123+
124+
Travis will then deploy to PyPI if tests pass.

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM python:3.12
2+
3+
ENV PYTHONUNBUFFERED 1
4+
5+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends \
6+
binutils \
7+
libproj-dev \
8+
gdal-bin \
9+
libgeoip1 \
10+
python3-gdal \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
# Requirements have to be pulled and installed here, otherwise caching won't work
14+
RUN pip install --no-cache-dir -U pip
15+
RUN pip install --no-cache-dir poetry poetry-plugin-export
16+
COPY pyproject.toml poetry.lock ./
17+
RUN poetry export --with dev --without-hashes -f requirements.txt > requirements.txt
18+
RUN pip install --no-cache-dir -r requirements.txt
19+
20+
COPY ./docker-entrypoint.sh /entrypoint.sh
21+
RUN sed -i 's/\r//' /entrypoint.sh
22+
RUN chmod +x /entrypoint.sh
23+
24+
WORKDIR /app
25+
26+
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)