uchicago-capp-30320 / new-arrivals-chi

GNU Affero General Public License v3.0
9 stars 0 forks source link

🤖 Add `Makefile` to make command executions easier. #151

Closed FedericoDM closed 6 months ago

FedericoDM commented 6 months ago

Describe your changes

Non-obvious technical information

The .PHONY part tells you how to run the make command. If you were to run the 'precommit' command, you would do:

make lint

For testing, you would do:

make test

Checklist before requesting a review

Here are the examples for running tests and linting

(new-arrivals-chi-py3.11) root@LAPTOP-RMMEN33V:/mnt/c/Users/fdmol/Desktop/MSCAPP/new-arrivals-chi# make lint
pre-commit run --all-files
trim trailing whitespace.................................................Passed
python tests naming......................................................Passed
check docstring is first.................................................Passed
check that executables have shebangs.....................................Passed
check json...........................................(no files to check)Skipped
check for case conflicts.................................................Passed
check toml...............................................................Passed
check for merge conflicts................................................Passed
check xml............................................(no files to check)Skipped
check yaml...............................................................Passed
fix end of files.........................................................Passed
check for broken symlinks............................(no files to check)Skipped
mixed line ending........................................................Passed
sort simple yaml files...............................(no files to check)Skipped
fix python encoding pragma...............................................Passed
pretty format json...................................(no files to check)Skipped
ruff.....................................................................Passed
flake8...................................................................Passed
csslint..................................................................Passed
black....................................................................Passed

(new-arrivals-chi-py3.11) root@LAPTOP-RMMEN33V:/mnt/c/Users/fdmol/Desktop/MSCAPP/new-arrivals-chi# make test
pytest tests
=================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.11.6, pytest-8.1.1, pluggy-1.4.0
rootdir: /mnt/c/Users/fdmol/Desktop/MSCAPP/new-arrivals-chi
configfile: pyproject.toml
plugins: Faker-25.0.0, flask-1.3.0
collected 6 items

tests/app_home_test.py .....                                                                                                                                                                                                                                                        [ 83%]
tests/db_test.py .                                                                                                                                                                                                                                                                  [100%]

==================================================================================================================================== warnings summary =====================================================================================================================================
tests/app_home_test.py::test_home_page_button_links
tests/db_test.py::test_user_organization_creation
  /root/.cache/pypoetry/virtualenvs/new-arrivals-chi-ntxjC1r9-py3.11/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:881: SAWarning: Can't sort tables for DROP; an unresolvable foreign key dependency exists between tables: hours, locations, organizations, users; and backend does not support ALTER.  To restore at least a partial sort, apply use_alter=True to ForeignKey and ForeignKeyConstraint objects involved in the cycle to mark these as known cycles that will be ignored.
    getattr(metadata, op_name)(bind=engine)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================================================================== 6 passed, 2 warnings in 0.39s ==============================================================================================================================
aaronhaefner commented 6 months ago

Can you commit the requirements.txt file to the repo? I think we should track that since we will expect package changes, and previous ones have triggered security alerts.

aaronhaefner commented 6 months ago

Probably also worth mentioning that poetry run make is also valid

FedericoDM commented 6 months ago

Done adding the requirements.txt @aaronhaefner :)