Skip to content

Commit

Permalink
Merge pull request #34 from cuducos/rust
Browse files Browse the repository at this point in the history
Replaces database by Rust crate
  • Loading branch information
cuducos authored May 9, 2024
2 parents 4ed5812 + 2d4b369 commit 663f953
Show file tree
Hide file tree
Showing 44 changed files with 751 additions and 1,433 deletions.
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
.env

# compiled source
*.pyc

# charts cache
whiskyton/static/charts/*

# logs and databases
*.log
*.db

# crates
target/
160 changes: 160 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ name = "crates"
crate-type = ["cdylib"]

[dependencies]
anyhow = "1.0.83"
chrono = "0.4.38"
csv = "1.3.0"
pyo3 = { version = "0.18", features = ["abi3-py311"] }
rand = "0.8.5"
regex = "1.10.4"
walkdir = "2.5.0"

[dev-dependencies]
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ RUN pip install poetry>=1.8.0 && \
poetry install --no-dev && \
poetry run pip install /wheels/*

ADD migrations/ migrations/
ADD whiskyton/ whiskyton/

CMD poetry run gunicorn --bind 0.0.0.0:$PORT whiskyton.wsgi:app
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ This was our very first project in Python.
2. Go to the repository folder:<br>`$ cd whiskyton`
3. Install the dependencies:<br>`$ poetry install`.
4. Install the Rust crates:<br>`$ poetry run pip install .`
5. Create and feed the database:<br>`$ poetry run flask --app whiskyton db upgrade`.
6. Run the server:<br>`$ poetry run flask --app whiskyton run`

## Tests
Expand All @@ -31,14 +30,6 @@ $ poetry run pytest

Some tests use your local [Firefox](http://mozilla.org/firefox/) through [Selenium](http://www.seleniumhq.org/). So get the server running before running tests.

## Managing the application

### Charts cache

If you want to get rid of all the cached SVG charts: `$ poetry run flask --app whiskyton charts delete`.

If you want to create all possible charts and cache the SVG files: `$ poetry run flask --app whiskyton charts create` (it is not necessary, the app creates and caches them on the fly; however pre-caching them can optimize page loading time).

Thanks
------

Expand Down
1 change: 0 additions & 1 deletion migrations/README

This file was deleted.

45 changes: 0 additions & 45 deletions migrations/alembic.ini

This file was deleted.

Loading

0 comments on commit 663f953

Please sign in to comment.