Skip to content

Commit

Permalink
adds mysql support
Browse files Browse the repository at this point in the history
  • Loading branch information
David Erb committed May 26, 2023
2 parents 91ac055 + 48b658b commit 55decae
Show file tree
Hide file tree
Showing 34 changed files with 952 additions and 132 deletions.
4 changes: 2 additions & 2 deletions .dae-devops/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

# ---------------------------------------------------------------------
Expand Down Expand Up @@ -69,4 +69,4 @@ publish_docs:
cp -r build/html/* $(DOCS_PUBLISH_ROOT)


# dae_devops_fingerprint 3f13d455c444ad39930aabfc68547c2c
# dae_devops_fingerprint 62bfff1938ace30f8cb33ab30b9c60d5
4 changes: 2 additions & 2 deletions .dae-devops/docs/conventions.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. # ********** Please don't edit this file!
.. # ********** It has been generated automatically by dae_devops version 0.5.2.
.. # ********** It has been generated automatically by dae_devops version 0.5.3.
.. # ********** For repository_name dls-normsql
Naming conventions
Expand Down Expand Up @@ -31,4 +31,4 @@ repository
lowercase, hyphens


.. # dae_devops_fingerprint 81e582297295ea8d1145aeb4fb60ffef
.. # dae_devops_fingerprint 8a72a4d0ee07d38513ef1273e9f9682e
5 changes: 2 additions & 3 deletions .dae-devops/docs/developing.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. # ********** Please don't edit this file!
.. # ********** It has been generated automatically by dae_devops version 0.5.2.
.. # ********** It has been generated automatically by dae_devops version 0.5.3.
.. # ********** For repository_name dls-normsql
Developing
Expand All @@ -22,7 +22,6 @@ Make sure to have at least python version 3.9 then::
Install the package in edit mode which will also install all its dependencies::

$ cd dls-normsql
$ export PIP_FIND_LINKS=/dls_sw/apps/bxflow/artifacts
$ pip install -e .[dev]

Now you may begin modifying the code.
Expand All @@ -36,4 +35,4 @@ If you plan to modify the docs, you will need to::


.. # dae_devops_fingerprint 550d6069746935ee4e08d958dd046fa2
.. # dae_devops_fingerprint 7b83e003f8bbbf54c27b4bd8141fb0e5
15 changes: 8 additions & 7 deletions .dae-devops/docs/devops.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
.. # ********** Please don't edit this file!
.. # ********** It has been generated automatically by dae_devops version 0.5.2.
.. # ********** It has been generated automatically by dae_devops version 0.5.3.
.. # ********** For repository_name dls-normsql
Devops
=======================================================================

There exists a a configuration file called ``.dae-devops/project.yaml``.
In the top level of the repository there exists a configuration file called ``.dae-devops/project.yaml``.

This file defines the project information needed for CI/CD.

It is parsed by the ``dae_devops.force`` command which creates these files:

- pyproject.toml
- .githib/*
- .gitlab-ci.yml
- .dae-devops/Makefile
- .dae-devops/docs/*

Local CI/CD execution
-----------------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All the CI/CD ops which are run by the git server can be run at the command line.

Expand All @@ -32,15 +33,15 @@ Validation of the code::
$ make -f .dae-devops/Makefile validate_pytest
$ make -f .dae-devops/Makefile validate_docs

Packaging::
Packaging (for the Diamond intranet)::

$ make -f .dae-devops/Makefile package_pip

Publishing::
Publishing (for the Diamond intranet)::

$ make -f .dae-devops/Makefile publish_pip
$ make -f .dae-devops/Makefile publish_docs
The Diamond intranet commands are not used for production. The production packaging and publishing are handled in the GitHub Actions workflows mechanism.


.. # dae_devops_fingerprint 35ea37a143cb4560425194afc2bad8ed
.. # dae_devops_fingerprint d9ee7cc6b002b3508a4e55f96193c35e
4 changes: 2 additions & 2 deletions .dae-devops/docs/docs_structure.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. # ********** Please don't edit this file!
.. # ********** It has been generated automatically by dae_devops version 0.5.2.
.. # ********** It has been generated automatically by dae_devops version 0.5.3.
.. # ********** For repository_name dls-normsql
About the documentation
Expand All @@ -21,4 +21,4 @@ improve most documentation - often immensely.

`More information on this topic. <https://documentation.divio.com>`_

.. # dae_devops_fingerprint 68095839584c6e3455c1bd06350312f4
.. # dae_devops_fingerprint eda941e8a0c3d217a601fb11b90f639b
7 changes: 3 additions & 4 deletions .dae-devops/docs/installing.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. # ********** Please don't edit this file!
.. # ********** It has been generated automatically by dae_devops version 0.5.2.
.. # ********** It has been generated automatically by dae_devops version 0.5.3.
.. # ********** For repository_name dls-normsql
Installing
Expand All @@ -26,18 +26,17 @@ installation will not interfere with any existing Python software::

You can now use ``pip`` to install the library and its dependencies::

$ export PIP_FIND_LINKS=/dls_sw/apps/bxflow/artifacts
$ python3 -m pip install dls-normsql

If you require a feature that is not currently released you can also install
from git::

$ python3 -m pip install git+https://gitlab.diamond.ac.uk/kbp43231/dls-normsql.git

The library should now be installed and the commandline interface on your path.
The library should now be installed and the commandline should be available.
You can check the version that has been installed by typing::

$ dls-normsql --version
$ dls-normsql --version-json

.. # dae_devops_fingerprint f0f3fa3bcf53a551add4ee39538eb44a
.. # dae_devops_fingerprint a2fe8dfbc79c151a5b899b244a529aa6
12 changes: 4 additions & 8 deletions .dae-devops/docs/testing.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. # ********** Please don't edit this file!
.. # ********** It has been generated automatically by dae_devops version 0.5.2.
.. # ********** It has been generated automatically by dae_devops version 0.5.3.
.. # ********** For repository_name dls-normsql
Testing
Expand All @@ -11,17 +11,13 @@ If you want to run the tests, first get a copy of the code per the instructions

Then you can run all tests by::

$ pytest

Or this, which is the command used by the CI runner.

$ make -f .dae-devops/Makefile validate_pytest
$ tox -q -e pytest

To run a single test you can do::

$ pytest tests/the_test_you_want.py

If you want to see more output of the test while it's running you can do:
If you want to see more output of the test while it's running you can do::

$ pytest -sv -ra --tb=line tests/the_test_you_want.py

Expand All @@ -35,4 +31,4 @@ This allows peeking in there to see what's been written by the test.



.. # dae_devops_fingerprint 16abfa1d4f582c07e1ea9281771b8f4f
.. # dae_devops_fingerprint 1801aaf6bd998d192c9fb4cdd6c3e79f
4 changes: 2 additions & 2 deletions .dae-devops/prepare_git_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

me=${BASH_SOURCE}
Expand All @@ -13,4 +13,4 @@ function __install {
}


# dae_devops_fingerprint d2a7e27cfad2e9f2547dc2b0da58fdd1
# dae_devops_fingerprint b7ad9765b7da993eecef6a4ce23802c2
5 changes: 4 additions & 1 deletion .dae-devops/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ primary:
dependencies:
- type: pypi
list:
- aiosqlite
- dls-utilpack
- aiosqlite
- aiomysql
# cryptography package is required for aiomysql sha256_password or caching_sha2_password auth methods
- cryptography
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

# This file is for use as a devcontainer and a runtime container
Expand Down Expand Up @@ -40,4 +40,4 @@ ENV PATH=/venv/bin:$PATH
ENTRYPOINT ["dls-normsql"]
CMD ["--version"]

# dae_devops_fingerprint 41ae7527130d2727aa06cd91ff8e5702
# dae_devops_fingerprint a5c05253a7982ce4ee2e60abd1a254f0
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ********** Please don't edit this file!
// ********** It has been generated automatically by dae_devops version 0.5.2.
// ********** It has been generated automatically by dae_devops version 0.5.3.
// ********** For repository_name dls-normsql

// For format details, see https://containers.dev/implementors/json_reference/
Expand Down Expand Up @@ -57,4 +57,4 @@
"postCreateCommand": "pip install -e .[dev]"
}

// dae_devops_fingerprint bf6676a0739eeb0e671f3518d7739877
// dae_devops_fingerprint 1c59c18009b5b4578be9201b399a2b6c
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. # ********** Please don't edit this file!
.. # ********** It has been generated automatically by dae_devops version 0.5.2.
.. # ********** It has been generated automatically by dae_devops version 0.5.3.
.. # ********** For repository_name dls-normsql
Contributing to the project
Expand Down Expand Up @@ -38,4 +38,4 @@ should follow.

.. _Developer Guide: https://diamondlightsource.github.io/dls-normsql/main/developer/how-to/contribute.html

.. # dae_devops_fingerprint e4fc983b36dd78a7c7fefcb6ac9fdd13
.. # dae_devops_fingerprint 1e4da81da23bd1f1ea6d675517d6f9c5
4 changes: 2 additions & 2 deletions .github/actions/install_requirements/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

name: Install requirements
Expand Down Expand Up @@ -61,4 +61,4 @@ runs:
shell: bash


# dae_devops_fingerprint 8d7ad9a9e4bbb3b504abc3a0f33579ee
# dae_devops_fingerprint 66e539b4856f80b66acfd95402e76d05
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

# To get started with Dependabot version updates, you'll need to specify which
Expand All @@ -19,4 +19,4 @@ updates:
schedule:
interval: "weekly"

# dae_devops_fingerprint b8759630d6502121150bac83a60ac05d
# dae_devops_fingerprint 61dd9f51dc2d4a0486ac8a76be91051f
4 changes: 2 additions & 2 deletions .github/pages/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- ********** Please don't edit this file! -->
<!-- ********** It has been generated automatically by dae_devops version 0.5.2. -->
<!-- ********** It has been generated automatically by dae_devops version 0.5.3. -->
<!-- ********** For repository_name dls-normsql -->

<!DOCTYPE html>
Expand All @@ -14,4 +14,4 @@

</html>

<!-- dae_devops_fingerprint d1650ec0d6d7791f6b665a22c9b8c4ff -->
<!-- dae_devops_fingerprint 4f2d286affbfbe691ff33fdbac641eb5 -->
4 changes: 2 additions & 2 deletions .github/pages/make_switcher.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

import json
Expand Down Expand Up @@ -102,4 +102,4 @@ def main(args=None):
if __name__ == "__main__":
main()

# dae_devops_fingerprint 321882bf975a37cedc9e7def02e120fa
# dae_devops_fingerprint dd357c9cfe8e116f70c977b7d94d62db
10 changes: 7 additions & 3 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

name: Code CI
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"] # can add windows-latest, macos-latest
python: ["3.10", "3.11"]
python: ["3.10"]
install: ["-e .[dev,docs]"]
# Make one version be non-editable to test both paths of version code
include:
Expand Down Expand Up @@ -69,6 +69,10 @@ jobs:
- name: List dependency tree
run: pipdeptree

# TODO: Make startup of MySQL able to be configured.
- name: Start up the MySQL that comes with Unbuntu
run: sudo /etc/init.d/mysql start

- name: Run tests
run: |
sudo apt install environment-modules
Expand Down Expand Up @@ -212,4 +216,4 @@ jobs:
with:
password: ${{ secrets.PYPI_TOKEN }}

# dae_devops_fingerprint 0eca35d77828ef5ba3c51d0d68628f12
# dae_devops_fingerprint d13e8289ca6252679ab7d9ae8db75617
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

name: Docs CI
Expand Down Expand Up @@ -56,4 +56,4 @@ jobs:
publish_dir: .github/pages
keep_files: true

# dae_devops_fingerprint ea6935f4eb0060233fc35dcccd2a0a36
# dae_devops_fingerprint 0c3ce8bebad77dab099617eae89e2247
4 changes: 2 additions & 2 deletions .github/workflows/docs_clean.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

name: Docs Cleanup CI
Expand Down Expand Up @@ -46,4 +46,4 @@ jobs:
git commit -am "Removing redundant docs version $DOCS_VERSION"
git push
# dae_devops_fingerprint 53d885e9033e0abb28bcc63d8252ca03
# dae_devops_fingerprint b47d6e45e6ea9f929b8afe4f238d9473
4 changes: 2 additions & 2 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

name: Link Check
Expand Down Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Check links
run: tox -e docs build -- -b linkcheck

# dae_devops_fingerprint f31df44c662aa0a356bb2a62fe64eade
# dae_devops_fingerprint 674bb9fc122cc739ba92fe18045f0f1f
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

variables:
Expand Down Expand Up @@ -87,4 +87,4 @@ package_pip:
# # The validate_docs artifacts are in the build/html folder.
# - make -f .dae-devops/Makefile publish_docs

# dae_devops_fingerprint 19ac89e7287f70ae7f5f96292102fde8
# dae_devops_fingerprint f4eece0911ee4d3dbab40d858bc4962d
4 changes: 2 additions & 2 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ********** Please don't edit this file! */
/* ********** It has been generated automatically by dae_devops version 0.5.2. */
/* ********** It has been generated automatically by dae_devops version 0.5.3. */
/* ********** For repository_name dls-normsql */

/* The theme normally has this, but I think it's ok to use the full width of the window in all @media sizes.
Expand All @@ -15,4 +15,4 @@
max-width: 100%;
}

/* dae_devops_fingerprint b13b064702739049faa6ce9119be9039 */
/* dae_devops_fingerprint cadc619d1b64a206ac3a5e05c7b9d498 */
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********** Please don't edit this file!
# ********** It has been generated automatically by dae_devops version 0.5.2.
# ********** It has been generated automatically by dae_devops version 0.5.3.
# ********** For repository_name dls-normsql

from pathlib import Path
Expand Down Expand Up @@ -197,4 +197,4 @@ def setup(app):
app.connect("source-read", ultimateReplace)


# dae_devops_fingerprint 404e6b95750b57333b0799fcd1a2c408
# dae_devops_fingerprint cd8b8b6c6077d960c9ed6af1579909b3
Loading

0 comments on commit 55decae

Please sign in to comment.