Skip to content

Commit

Permalink
Merge pull request #42 from melexis/fix-artifacts
Browse files Browse the repository at this point in the history
Convert to a namespace package and upgrade GitHub actions
  • Loading branch information
JasperCraeghs authored Sep 12, 2024
2 parents 31c30fd + d232016 commit 258bff4
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 42 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Build documentation with Sphinx 2.1
run: tox -e sphinx2.1
- name: Build documentation with Sphinx 2.4.5
run: tox -e sphinx2.4.5
- name: Build documentation with latest Sphinx versions
run: tox -e sphinx-latest
- name: Static checks
if: matrix.python-version == 3.9
run: tox -e check
- name: Upload HTML documentation
if: matrix.python-version == 3.9
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html-doc
path: doc/_build/html
Expand All @@ -40,9 +40,9 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download HTML documentation from job 'test'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: html-doc
path: doc/_build/html
Expand All @@ -54,17 +54,17 @@ jobs:
branch: gh-pages
folder: doc/_build/html
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ wheels/
.installed.cfg
*.egg
MANIFEST
mlx/__robot2rst_version__.py
mlx/*/__version__.py

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ recursive-include doc *.robot
recursive-include doc *.rst
recursive-include doc Makefile
exclude doc/source/*_qtp.rst
exclude mlx/__robot2rst_version__.py
exclude mlx/robot2rst/__version__.py

# added by check_manifest.py
include tox.ini
9 changes: 6 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import os
import mlx.traceability
from pkg_resources import get_distribution
from importlib.metadata import distribution
from pathlib import Path

# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -21,7 +22,7 @@
authors = ['Stein Heselmans', 'Jasper Craeghs']

# The full version, including alpha/beta/rc tags
release = get_distribution('mlx.robot2rst').version
release = distribution('mlx.robot2rst').version
version = '.'.join(release.split('.')[:2])

man_pages = [
Expand Down Expand Up @@ -71,7 +72,9 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = [os.path.join(os.path.dirname(mlx.traceability.__file__), 'assets')]
html_static_path = [
str(Path(mlx.traceability.__file__).parent / 'assets'),
]


def setup(app):
Expand Down
1 change: 0 additions & 1 deletion mlx/__init__.py

This file was deleted.

Empty file added mlx/robot2rst/__init__.py
Empty file.
6 changes: 3 additions & 3 deletions mlx/robot2rst.mako → mlx/robot2rst/robot2rst.mako
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def to_traceable_item(name, prefix=''):
# Move to capitals
name = name.upper()
# Replace ' : ' (or alike) by '-'
name = re.sub('\s*:\s*', '-', name)
name = re.sub(r'\s*:\s*', '-', name)
# Replace '&' by 'AND'
name = name.replace('&', 'AND')
# Remove other special characters
name = re.sub('[^\w\s_-]', '', name)
name = re.sub(r'[^\w\s_-]', '', name)
# Replace spaces with single underscore
name = re.sub('\s+', '_', name)
name = re.sub(r'\s+', '_', name)
return name
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = ["setuptools>=61", "setuptools_scm>=7.1.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "mlx/robot2rst/__version__.py"
16 changes: 7 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
from setuptools import find_namespace_packages, setup

project_url = 'https://github.com/melexis/robot2rst'

requires = ['robotframework>=3.2', 'mako']

setup(
name='mlx.robot2rst',
use_scm_version={'write_to': 'mlx/__robot2rst_version__.py'},
url=project_url,
author='Jasper Craeghs',
author_email='[email protected]',
Expand All @@ -25,27 +24,26 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Documentation',
'Topic :: Documentation :: Sphinx',
'Topic :: Utilities',
],
platforms='any',
packages=find_packages(exclude=['tests', 'doc']),
packages=find_namespace_packages(where=".", exclude=("doc.*", "doc", "build*")),
package_dir={"": "."},
include_package_data=True,
install_requires=requires,
setup_requires=['setuptools_scm'],
python_requires='>=3.7',
namespace_packages=['mlx'],
python_requires='>=3.8',
keywords=['robot', 'robotframework', 'sphinx', 'traceability'],
entry_points={
'console_scripts': [
'mlx.robot2rst = mlx.robot2rst:entrypoint',
'robot2rst = mlx.robot2rst:entrypoint',
'mlx.robot2rst = mlx.robot2rst.robot2rst:entrypoint',
'robot2rst = mlx.robot2rst.robot2rst:entrypoint',
]
},
)
32 changes: 20 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
[tox]
envlist =
check,
py37, py38, py39, py310, py311
sphinx2.1,
py38, py39, py310, py311, py312
sphinx2.4.5,
sphinx-latest,

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
basepython =
py: python3
py37: {env:TOXPYTHON:python3.7}
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
py310: {env:TOXPYTHON:python3.10}
py311: {env:TOXPYTHON:python3.11}
{check,sphinx2.1,sphinx-latest}: python3
py312: {env:TOXPYTHON:python3.12}
{check,sphinx2.4.5,sphinx-latest}: python3
passenv =
*
usedevelop = true
Expand All @@ -30,7 +30,8 @@ deps=
mako
sphinx-testing >= 1.0.0
sphinx_rtd_theme
mlx.traceability >= 4.2.0
matplotlib >= 3.7.5
mlx.traceability >= 11.6.0

[testenv:check]
deps =
Expand All @@ -44,29 +45,36 @@ commands =
check-manifest {toxinidir} -u
flake8 mlx setup.py

[testenv:sphinx2.1]
[testenv:sphinx2.4.5]
deps=
{[testenv]deps}
jinja2 == 2.11.3
markupsafe == 1.1.0
docutils == 0.17
sphinx <= 2.1.9999
mlx.warnings >= 4.3.2
sphinx == 2.4.5
sphinxcontrib-applehelp<=1.0.4
sphinxcontrib-devhelp<=1.0.4
sphinxcontrib-htmlhelp<=2.0.4
sphinxcontrib-serializinghtml<=1.1.9
sphinxcontrib-qthelp<=1.0.6
alabaster<=0.7.13
mlx.warnings >= 5.4.1
sphinx_selective_exclude >= 1.0.3
whitelist_externals =
make
mlx-warnings
commands=
mlx-warnings --sphinx --exact-warnings 1 --command make -C doc html
mlx-warnings --config warnings_config.yml --command make -C doc html

[testenv:sphinx-latest]
deps=
{[testenv]deps}
sphinx
mlx.warnings >= 4.3.2
sphinx_rtd_theme >= 3.0.0rc1
mlx.warnings >= 5.4.1
sphinx_selective_exclude >= 1.0.3
whitelist_externals =
make
mlx-warnings
commands=
mlx-warnings --sphinx --exact-warnings 1 --command make -C doc html
mlx-warnings --config warnings_config.yml --command make -C doc html
18 changes: 18 additions & 0 deletions warnings_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sphinx:
enabled: true
min: 1
max: 1
exclude:
- 'WARNING: cannot cache unpickable configuration value: .traceability_attributes_sort. \(because it contains a function, class, or module object\)'
doxygen:
enabled: false
junit:
enabled: false
xmlrunner:
enabled: false
coverity:
enabled: false
robot:
enabled: false
polyspace:
enabled: false

0 comments on commit 258bff4

Please sign in to comment.