Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bradbell/xrst
Browse files Browse the repository at this point in the history
The only conflicts were the cuurent dates.
  • Loading branch information
bradbell committed Aug 25, 2024
2 parents 943c570 + 971a399 commit d33e432
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ __pycache__/
*.log
*.swp
*.tmp
# MacOS special cases
/.tox/
/pytest/test_rst.py-e
10 changes: 9 additions & 1 deletion bin/check_tab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ then
echo "bin/check_tab.sh: must be executed from its parent directory"
exit 1
fi
#
# grep
if which ggrep >& /dev/null
then
grep=$(which ggrep)
else
grep='grep'
fi
# -----------------------------------------------------------------------------
ok='yes'
for file in $(git ls-files)
do
if grep -P '\t' $file > /dev/null
if $grep -P '\t' $file > /dev/null
then
echo "$file has a tab"
ok='no'
Expand Down
21 changes: 15 additions & 6 deletions bin/check_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ set -e -u
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]>
# SPDX-FileContributor: 2020-24 Bradley M. Bell
# -----------------------------------------------------------------------------
# bash function that echos and executes a command
#
# echo_eval
echo_eval() {
echo $*
eval $*
}
#
# sed
if which gsed >& /dev/null
then
sed=gsed
else
sed=sed
fi
# -----------------------------------------------------------------------------
# BEGIN: SECTION THAT DEPENDS ON GIT REPOSITORY
#
Expand All @@ -30,7 +39,7 @@ version_files='
# create_temp_sed
# The sed script temp.sed is used to check the version number in files above.
function create_temp_sed {
year=$( echo $version | sed -e 's|\..*||' )
year=$( echo $version | $sed -e 's|\..*||' )
cat << EOF > temp.sed
#
# xrst/user.xrst
Expand Down Expand Up @@ -62,7 +71,7 @@ fi
# -----------------------------------------------------------------------------
# check_version
check_version() {
sed "$1" -f temp.sed > temp.out
$sed "$1" -f temp.sed > temp.out
if ! diff "$1" temp.out > /dev/null
then
version_ok='no'
Expand All @@ -83,12 +92,12 @@ branch=$(git rev-parse --abbrev-ref HEAD)
#
# version
version=$(
sed -n -e '/^ *version *=/p' $stable_version_file | \
sed -e 's|.*= *||' -e "s|'||g"
$sed -n -e '/^ *version *=/p' $stable_version_file | \
$sed -e 's|.*= *||' -e "s|'||g"
)
if [ "$branch" == 'master' ] || [ "$branch" == 'main' ]
then
version=$(date +%Y.%m.%d | sed -e 's|\.0*|.|g')
version=$(date +%Y.%m.%d | $sed -e 's|\.0*|.|g')
fi
if echo $branch | grep '^stable/' > /dev/null
then
Expand Down
11 changes: 9 additions & 2 deletions bin/check_xrst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,19 @@ else
fi
print_variable PYTHONPATH
# -----------------------------------------------------------------------------
#
# number_jobs
if [ $(nproc) == '1' ] || [ $(nproc) == '2' ]
if which nproc >& /dev/null
then
n_proc=$(nproc)
else
n_proc=$(sysctl -n hw.ncpu)
fi
if [ $n_proc == '1' ] || [ n_proc == '2' ]
then
number_jobs='1'
else
let number_jobs="$(nproc) - 1"
let number_jobs="$n_proc - 1"
fi
# -----------------------------------------------------------------------------
# index_page_name
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend = 'setuptools.build_meta'
# -----------------------------------------------------------------------------
[project]
name = 'xrst'
version = '2024.8.15'
version = '2024.8.25'
description = 'Extract RST files from source code and run Sphinx'
readme = 'readme.md'
requires-python = '>=3.0'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name = 'xrst',
version = '2024.8.15',
version = '2024.8.25',
description = 'Extract RST files from source code and run Sphinx',
license = 'GPL-3.0-or-later',
keywords = 'sphinx rst documentation source',
Expand Down
4 changes: 2 additions & 2 deletions test_rst/config_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ Example
=======

.. literalinclude:: ../../xrst.toml
:lines: 71-96
:lines: 71-97
:language: toml

.. index:: not_in_index
Expand Down Expand Up @@ -498,5 +498,5 @@ Example
=======

.. literalinclude:: ../../xrst.toml
:lines: 100-129
:lines: 101-130
:language: toml
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]>
# SPDX-FileContributor: 2020-23 Bradley M. Bell
# SPDX-FileContributor: 2020-24 Bradley M. Bell
#
[tox]
# see python requires-python in pyproject.toml
envlist = {py3.12, py3.11, py3.10, py3.9, py3.8}
# envlist = {py3.12, py3.11, py3.10, py3.9, py3.8}
# pyenchant does not work on MacOS with older versions of python
envlist = {py3.12, py3.11, py3.10}
skipsdist = true

[testenv]
Expand Down
1 change: 1 addition & 0 deletions xrst.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ data = [
''',
# abbreviations
'''
config
dir
toc
tmp
Expand Down
2 changes: 1 addition & 1 deletion xrst/run_xrst.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def fix_latex(latex_dir, project_name) :
import xrst
#
# version
version = '2024.8.15'
version = '2024.8.25'
#
def run_xrst() :
#
Expand Down

0 comments on commit d33e432

Please sign in to comment.