From 34355ec6262a0fac546ec45f64197444e9082905 Mon Sep 17 00:00:00 2001 From: Bram Goessens Date: Fri, 28 Jun 2024 13:31:45 +0200 Subject: [PATCH] Update instructions to setup atramhasis projects using cookiecutter Delete obsolete README files --- cookiecutters/demo/README.rst | 44 --------------------- cookiecutters/scaffold/README.rst | 41 -------------------- docs/source/customisation.rst | 63 ++++++++++++++++++++++++++++++- 3 files changed, 61 insertions(+), 87 deletions(-) delete mode 100644 cookiecutters/demo/README.rst delete mode 100644 cookiecutters/scaffold/README.rst diff --git a/cookiecutters/demo/README.rst b/cookiecutters/demo/README.rst deleted file mode 100644 index 811d0856..00000000 --- a/cookiecutters/demo/README.rst +++ /dev/null @@ -1,44 +0,0 @@ -======================= -atramhasis demo project -======================= - -Requirements ------------- - -* Python 3.9+ -* npm - -Usage ------ - -#. Use cookiecutter to generate an atramhasis demo project - - .. code-block:: bash - - $ cookiecutter gh:OnroerendErfgoed/atramhasis --directory cookiecutters/demo - -#. Create a virtual environment and install requirements - - .. code-block:: bash - - # create a new virtual environment for the project, fe python -m venv $HOME/.virtualenvs/atramhasis_demo_venv - # Change directory into your newly created project if not already there. - # The [dev] optional requirement will install the waitress WSGI server. - # You are of course free to choose another. - $ pip install -e .[dev] - -#. Setup database - - .. code-block:: bash - - alembic upgrade head - # fill the database with data - initialize_atramhasis_db development.ini - - -#. Run server - - .. code-block:: bash - - cd - pserve development.ini diff --git a/cookiecutters/scaffold/README.rst b/cookiecutters/scaffold/README.rst deleted file mode 100644 index 8b6241fa..00000000 --- a/cookiecutters/scaffold/README.rst +++ /dev/null @@ -1,41 +0,0 @@ -================== -atramhasis project -================== - -Requirements ------------- - -* Python 3.9+ -* npm - -Usage ------ - -#. Use cookiecutter to generate an atramhasis project - - .. code-block:: bash - - $ cookiecutter gh:OnroerendErfgoed/atramhasis --directory cookiecutters/scaffold - -#. Create a virtual environment and install requirements - - .. code-block:: bash - - # create a new virtual environment for the project, fe python -m venv $HOME/.virtualenvs/atramhasis_demo_venv - # Change directory into your newly created project if not already there. - # The [dev] optional requirement will install the waitress WSGI server. - # You are of course free to choose another. - $ pip install -e .[dev] - -#. Setup database - - .. code-block:: bash - - $ alembic upgrade head - -#. Run server - - .. code-block:: bash - - $ cd - $ pserve development.ini diff --git a/docs/source/customisation.rst b/docs/source/customisation.rst index b03c4474..f8f0f02d 100644 --- a/docs/source/customisation.rst +++ b/docs/source/customisation.rst @@ -16,9 +16,68 @@ instance with only these default settings. Creating your own project ========================= -Follow the README at `atramhasis scaffold cookiecutter `_ +Requirements +------------ + +* Python 3.9+ +* npm + +Usage +----- + + +1. Preferably, create a virtual environment specifically to setup your project. +You can alternatively use the atramhasis_dev environment that you created following the +instructions in https://atramhasis.readthedocs.io/en/latest/development.html#general-installation. + + .. code-block:: bash + # create a new virtual environment to setup your project + $ python -m venv atramhasis_setup + $ . atramhasis_dev/bin/activate + # Make sure pip and pip-tools are up to date + $ pip install --upgrade pip pip-tools + $ pip install --upgrade cookiecutter + +2. Use cookiecutter to generate an atramhasis project + + .. code-block:: bash + + $ cookiecutter gh:OnroerendErfgoed/atramhasis --directory cookiecutters/scaffold + +3. Create a virtual environment and install requirements + + .. code-block:: bash + + # create a new virtual environment for the project, fe python -m venv $HOME/.virtualenvs/atramhasis_demo_venv + # Change directory into your newly created project if not already there. + # The [dev] optional requirement will install the waitress WSGI server. + # You are of course free to choose another. + $ pip install -e .[dev] + + + +# Install dependencies +$ pip-sync requirements-dev.txt +# Install Inventaris in dev mode +$ pip install -e . + + + + +4. Setup database + + .. code-block:: bash + + $ alembic upgrade head + +5. Run server + + .. code-block:: bash + + $ cd + $ pserve development.ini + -This gives you a clean slate to start your customisations on. Database --------