Skip to content

Commit

Permalink
Build + development environment switched to Poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Dani Ramirez committed Feb 2, 2019
1 parent 78bc949 commit 6566bb2
Show file tree
Hide file tree
Showing 11 changed files with 473 additions and 544 deletions.
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

26 changes: 0 additions & 26 deletions Pipfile

This file was deleted.

411 changes: 0 additions & 411 deletions Pipfile.lock

This file was deleted.

42 changes: 25 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ A **new** bunch of middleware functions to build applications on top of CARTO.
- [ ] Database model
- [x] CARTO data source
- [x] Basic parametrized queries (i.e. templated queries)
- [ ] Protected parametrized queries (i.e. avoiding injection)
- [x] Protected parametrized queries (i.e. avoiding injection)
- [ ] Bind/dynamic parameters in queries (server-side render)
- [ ] Postgres data source
- [x] Postgres data source
- [x] psycopg2
- [ ] SQLAlchemy
- [ ] Asyncpg
- [x] SQLAlchemy
- [x] Cache
- [x] Base cache
- [x] Put
Expand All @@ -24,14 +23,14 @@ A **new** bunch of middleware functions to build applications on top of CARTO.
- [x] Tests
- [x] Redis Cache
- [x] Tests
- [ ] Documentation
- [x] Documentation
- [x] Sample scripts
- [x] Unit tests
- [x] Sample scripts

- [ ] Config
- [x] Config

- [ ] CI PyPi versioning
- [x] CI PyPi versioning

- [ ] Data manipulation
- [ ] Carto
Expand Down Expand Up @@ -77,22 +76,31 @@ pip install -e git+https://github.com/GeographicaGS/Longitude#egg=longitude

## As developer...

Install pipenv in your development machine if you still do not have it.
### First time

Set up Python environment:
1. Install ```poetry``` using the [recommended process](https://github.com/sdispater/poetry#installation)
1. poetry is installed globally as a tool
1. It works along with virtualenvironments
1. Create a virtual environment for Python 3.x (check the current development version in ```pyproject.toml```)
1. You can create it wherever you want but do not put it inside the project
1. A nice place is ```$HOME/virtualenvs/longitude```
1. Clone the ```longitude``` repo
1. `cd` to the repo and:
1. Activate the virtual environment: `. ~/virtualenvs/longitude/bin/activate`
1. Run `poetry install`
1. Configure your IDE to use the virtual environment

```shell
$ cd [path-to-longitude-folder]
$ pipenv install
```
### Daily

To activate the virtual environment: `$ pipenv shell`. If the environment variables are defined in a `.env` file, they are loaded in this shell.
1. Remember to activate the virtual environment

## Sample scripts
### Why Poetry?

These are intended to be used with real databases (i.e. those in your profile) to check features of the library.
Because it handles development dependencies and packaging with a single file (```pyproject.toml```), which is [already standard](https://flit.readthedocs.io/en/latest/pyproject_toml.html).

## Sample scripts

You will probably need to provide credentials/api keys/urls/username/... Check each script and it will be explained there.
These are intended to be used with real databases (i.e. those in your profile) to check features of the library. They must be run from the virtual environment.

## Testing and coverage

Expand Down
3 changes: 1 addition & 2 deletions longitude/samples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
carto_sample_config.py
postgres_sample_config.py
*_sample_config.py
Empty file removed longitude/samples/load_sys_path.py
Empty file.
5 changes: 0 additions & 5 deletions longitude/samples/sqlalchemy_sample_config.py

This file was deleted.

Loading

0 comments on commit 6566bb2

Please sign in to comment.