The easiest way to have the environment setup is using conda. Conda is the most recommended package manager for scientific and data python stack.
If you don't have it installed, you can install it via mambaforge: https://github.com/conda-forge/miniforge#mambaforge
Mamba is a fast layer on top of conda that will speed up the way that conda works.
When you have the conda installed, you can proceed and create a new conda environment for epigraphhub.
mamba env create --file conda/dev.yaml
This command will create a new conda environment with some development dependencies for epigraphhub. In order to proceed, you will need first activate your environment:
conda activate epigraphhubpy
Now, you can install the epigraphhub dependencies with:
poetry install
epigraphhub_py
needs a configuration file in order to access the database.
After you have the library installed, you can run the following command (just an example):
epigraphhub-config \
--name "epigraphhub" \
--db-default-credential "epigraphhub" \
--db-uri "dev_epigraph:dev_epigraph@localhost:25432/dev_epigraphhub"
Where:
--name
is required, it defines the name for the credential--db-default-credential
is optional. When you create the first credential, it set automaticallydb-default-credential
to this first one created.--db-uri
specify the URI for the database using SQLAlchemy URI format.
The name for the credential doesn't matter, but this same name should be used when you are making a connection to the database with the EpiGraphHub library.
For development, if you are using the postgres container that we have prepared here, you can run this, instead:
makim config.create-file
This depends on a environment variables file (.env
) at docker
folder.
You can create one based on docker/.env.tpl
. Or you can use this:
POSTGRES_HOST=localhost
POSTGRES_PORT=25432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_EPIGRAPH_USER=dev_epigraph
POSTGRES_EPIGRAPH_PASSWORD=dev_epigraph
POSTGRES_EPIGRAPH_DB=dev_epigraphhub
This is the default environment variables used by development.
If you don't have the databases for development yet, you can create one locally using containers-sugar:
containers-sugar build
containers-sugar start
The makim tests.check-safety
command will look at the security of your code.
Command makim tests.linter
applies all checks.
Before submitting your code please do the following steps:
- Run
pre-commit install
. - Add any changes you want
- Add tests for the new changes
- Edit documentation if you have changed something significant
- Now, any new commit will run some tools to check and format the code.
You can contribute by spreading a word about this library. It would also be a huge contribution to write a short article on how you are using this project. You can also share your best practices with us.