Welcome to the readme
To Setup and Develop
- Install
pipenv
usingpip
- Instantiate a pipenv environment using
pipenv shell
- While inside the environment you can run
tox
orpytest tests
to run tests- Running
tox
will require that you have both py27 and py38 environments installed - Running
pytest
will only test with the current virtual environment (configured to be py38) - See
tox.ini
file for test configuration
- Running
- Ensure that the directory
~/.config/lightcurvedb/
exists with a configuration filedb.conf
- There should be a
[Credentials]
subfield with the valuesusername=psql-username
password=psswrd
database_name=lightcurve
database_host=filesystem.domain.com
database_port=5432
- There should be a
Changing virtualenv for development
- Edit pipenv file and locate the python version option, edit as necessary
- Adding or removing packages should be done via
pipenv install
orpipenv uninstall
and not throughpip
aspip
will not update thePipenv.lock
file.
Deployment (From clean install)
- Ensure postgresql (>= 9.6) is installed
- Create a database (e.g
lightcurve
) - Install
lightcurvedb
usingpip install .
- Copy
alembic.ini.example
toalembic.ini
- Configure the
alembic.ini
field:sqlalchemy.url
to point to the url of the database - Run
alembic upgrade head
to run migrations
- Configure the
- Ingest wanted data using provided CLI tools
Development workflow
All edits should be done on a separate branch from master with a name relevant to the set of changes.
During the development of the branch, any relevant tests should be placed in the tests
directory.
- Create a branch for your changes
git branch -b [your-branch-name]
- Make your changes and create any relevant tests in
tests
- Pytest discovers tests with files with the name schema:
test_filename.py
- Pytest discovers test functions with the name
def test_foo(arg1, ...): bar
- Remember
tox
will run all test functions through python 2 and 3
- Pytest discovers tests with files with the name schema:
- After review make a
merge request
for code review and final merging with master