Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically insert mss version and search result #1071

Merged
merged 5 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import sys
import logging
import setuptools
import subprocess
from string import Template

if os.getenv("PROJ_LIB") is None or os.getenv("PROJ_LIB") == "PROJ_LIB":
conda_file_dir = setuptools.__file__
Expand Down Expand Up @@ -117,6 +119,20 @@
# The full version, including alpha/beta/rc tags.
release = __version__

# Replace $variables in the .rst files if on a readthedocs worker
if "/home/docs/checkouts" in " ".join(sys.argv):
mss_search = subprocess.run(["conda", "search", "-c", "conda-forge", "mss"], stdout=subprocess.PIPE,
Marilyth marked this conversation as resolved.
Show resolved Hide resolved
stderr=subprocess.STDOUT, encoding="utf8").stdout
mss_search = " ".join([line for line in mss_search.splitlines(True) if line.startswith("mss ")][-2:])
Marilyth marked this conversation as resolved.
Show resolved Hide resolved

for file in os.listdir():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a comment someone else falls over this
file was in Py 2 a builtin and this was removed in Py 3 by the io framework

if file.endswith(".rst"):
with open(file, "r") as rst:
content = Template(rst.read())
with open(file, "w") as rst:
rst.write(content.safe_substitute(mss_version=version[:-1] if version[-1] == "." else version,
mss_search=mss_search))

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
Expand Down
8 changes: 4 additions & 4 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
2. Software requirement
| Python
| `Additional Requirements <https://github.com/Open-MSS/MSS/blob/develop/requirements.d/development.txt>`_


3. Skill set
| Knowledge of git & github
Expand All @@ -22,7 +22,7 @@ Setting Up local Environement
============================
Forking the Repo
============================
Marilyth marked this conversation as resolved.
Show resolved Hide resolved
1. Firstly you have to make your own copy of project. For that you have to fork the repository. You can find the fork button on the top-right side of the browser window.
1. Firstly you have to make your own copy of project. For that you have to fork the repository. You can find the fork button on the top-right side of the browser window.

2. Kindly wait till it gets forked.

Expand Down Expand Up @@ -145,7 +145,7 @@ Create an environment and install the whole mss package dependencies then remove

$ conda create -n mssdev mamba
$ conda activate mssdev
$ mamba install mss=4.0.1 --only-deps
$ mamba install mss=$mss_version --only-deps

You can also use conda to install mss, but mamba is a way faster.
Compare versions used in the meta.yaml between stable and develop branch and apply needed changes.
Expand Down Expand Up @@ -282,7 +282,7 @@ If you don't have a stable branch, create one first or change to that branch::
Merging stable into develop
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bug fixes we have done in stable we need to merge regulary into develop too::
Bug fixes we have done in stable we need to merge regulary into develop too::

git checkout stable
git pull git@github.com:Open-MSS/MSS.git stable
Expand Down
11 changes: 5 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ leave out the 'source' here and below). ::

$ conda create -n mssenv mamba
$ conda activate mssenv
(mssenv) $ mamba install mss=4.0.1 python
(mssenv) $ mamba install mss=$mss_version python


You need to reactivate after the installation once the environment to setup all needed enironment
Expand All @@ -82,8 +82,7 @@ search for MSS what you can get ::

(mssenv) $ mamba search mss
...
mss 4.0.1 py38h578d9bd_0 conda-forge
mss 4.0.1 py39hf3d152e_0 conda-forge
$mss_search

compare what you have installed ::

Expand All @@ -93,9 +92,9 @@ compare what you have installed ::


We have reports that often an update suceeds by using the install option and the new version number,
in this example 4.0.1 and python as second option ::
in this example $mss_version and python as second option ::

(mssenv) $ mamba install mss=4.0.1 python
(mssenv) $ mamba install mss=$mss_version python

All attemmpts show what you get if you continue. **Continue only if you get what you want.**

Expand Down Expand Up @@ -123,7 +122,7 @@ We suggest to create a mss user.
* login again or export PATH="/home/mss/miniconda3/bin:$PATH"
* conda create -n mssenv mamba
* conda activate mssenv
* mamba install mss=4.0.1 python
* mamba install mss=$mss_version python

For a simple test you could start the builtin standalone *mswms* and *mscolab* server::

Expand Down