Skip to content

Commit

Permalink
new devops
Browse files Browse the repository at this point in the history
  • Loading branch information
David Erb committed Jun 5, 2023
1 parent 95debea commit fa5b070
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 34 deletions.
15 changes: 4 additions & 11 deletions .dae-devops/docs/developing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ If you plan to make change to the code in this repository, you can use the steps

Clone the repository::

$ cd <your development area>
$ git clone https://github.com/diamondlightsource/xchembku/xchembku.git

It is recommended that you install into a virtual environment so this
installation will not interfere with any existing Python software.
Make sure to have at least python version 3.9 then::
Make sure to have at least python version 3.10 then::

$ python3 -m venv /scratch/$USER/myvenv
$ source /scratch/$USER/myvenv/bin/activate
Expand All @@ -22,17 +23,9 @@ 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 xchembku
$ pip install -e .[dev]
$ pip install -e .[dev,docs]

Now you may begin modifying the code.

|

If you plan to modify the docs, you will need to::

$ pip install -e .[docs]



.. # dae_devops_fingerprint b8e50fbfb03247dcba32527a1bce43ac
.. # dae_devops_fingerprint 7ed6884248b751dc449fb414a1ca82e1
30 changes: 30 additions & 0 deletions .dae-devops/docs/documenting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. # ********** Please don't edit this file!
.. # ********** It has been generated automatically by dae_devops version 0.5.3.
.. # ********** For repository_name xchembku
Documenting
=======================================================================

If you plan to make update the documentation in this repository, you can use the steps below.

First, follow the steps in the Developing section to get a copy of the source code and install its dependencies.

If you didn't do this already, make sure you have the documentation tools::

$ cd <your development area>/xchembku
$ pip install -e .[docs]

To produce the documentation locally::

$ tox -q -e docs

This writes the html into local directory build/html. You can browse the local documentation by::

file:///<your development area>/xchembku/build/html/index.html

When you push either the main branch or a tag to GitHub, the documents are built and published automatically to this url::

https://diamondlightsource.github.io/xchembku/main/index.html


.. # dae_devops_fingerprint 863eadb28713e672ac42c9886c928db0
14 changes: 7 additions & 7 deletions .dae-devops/docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Installing
=======================================================================


You will need python 3.9 or later.
You will need python 3.10 or later.

On a Diamond Light Source internal computer, you can achieve Python 3.9 by::
On a Diamond Light Source internal computer, you can achieve Python 3.10 by::

$ module load python/3.9
$ module load python/3.10

You can check your version of python by typing into a terminal::

Expand All @@ -24,19 +24,19 @@ installation will not interfere with any existing Python software::
$ pip install --upgrade pip


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

$ python3 -m pip install xchembku

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

$ python3 -m pip install git+https://github.com/diamondlightsource/xchembku/xchembku.git

The library should now be installed and the commandline should be available.
The package should now be installed and the command line should be available.
You can check the version that has been installed by typing::

$ xchembku --version
$ xchembku --version-json

.. # dae_devops_fingerprint b0dd26d8e2897f65f63f81a16b0a8e29
.. # dae_devops_fingerprint e17b07ee438d265975080254e6435145
6 changes: 3 additions & 3 deletions .dae-devops/docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ If you want to see more output of the test while it's running you can do::

Each test will write files into its own directory::

/tmp/xchembku/tests/....
/tmp/xchembku/tests/*

The tests clear their directory when they start, but not when they finish.
This allows peeking in there to see what's been written by the test.
This allows you to examine what's been written by the test.




.. # dae_devops_fingerprint a8eba26c733cc75e40ad8560dd959093
.. # dae_devops_fingerprint e60d69a5aa7ae4acb6ba6e90dcff15cb
7 changes: 1 addition & 6 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ jobs:
os: ["ubuntu-latest"] # can add windows-latest, macos-latest
python: ["3.10"]
install: ["-e .[dev,docs]"]
# Make one version be non-editable to test both paths of version code
include:
- os: "ubuntu-latest"
python: "3.9"
install: ".[dev,docs]"

runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -216,4 +211,4 @@ jobs:
with:
password: ${{ secrets.PYPI_TOKEN }}

# dae_devops_fingerprint b95f4d599ba467ac167ad6ea2a446537
# dae_devops_fingerprint fd9227ec7552b75511373c7ecd644d4d
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def ultimateReplace(app, docname, source):
"$" + "{repository_name}": "xchembku",
"$" + "{package_name}": "xchembku_lib",
"$" + "{git_url}": "https://github.com/diamondlightsource/xchembku",
"$" + "{python_version_at_least}": "3.9",
"$" + "{python_version_at_least}": "3.10",
}


Expand All @@ -197,4 +197,4 @@ def setup(app):
app.connect("source-read", ultimateReplace)


# dae_devops_fingerprint 3e5f08df87ebb37ddf17572d476185a2
# dae_devops_fingerprint c1c571c112da8688ea81070cffde5401
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ name = "xchembku"
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
description = "XChem Business Knowledge Unit. Service, Client, API, persistent store."
dependencies = ["dls_servbase", "dls_mainiac", "dls_multiconf", "dls_utilpack", "soakdb3", "pydantic"]
dynamic = ["version"]
license.file = "LICENSE"
readme = "README.rst"
requires-python = ">=3.9"
readme = "README.md"
requires-python = ">=3.10"

[project.optional-dependencies]
dev = [
Expand Down Expand Up @@ -103,4 +101,4 @@ source = ["src", "**/site-packages/"]
[tool.tox]
legacy_tox_ini = "[tox]\nskipsdist=True\n\n[testenv:{pre-commit,mypy,pytest,docs}]\n# Don't create a virtualenv for the command, requires tox-direct plugin\ndirect = True\npassenv = *\nallowlist_externals = \n pytest \n pre-commit\n mypy\n sphinx-build\n sphinx-autobuild\ncommands =\n pytest: pytest {posargs}\n mypy: mypy src tests {posargs}\n pre-commit: pre-commit run --all-files {posargs}\n docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html\n"

# dae_devops_fingerprint c6a28d0d6afaffc18e6857fe4c60799f
# dae_devops_fingerprint 0e49b85fe4d7a2a5abd589d879846417

0 comments on commit fa5b070

Please sign in to comment.