diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c79503e..4316139 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,7 +70,7 @@ jobs: fail-fast: false matrix: # as now the various plumed support sites use 3.9 and 3.8 (and with 3.10 starts to fail...) - python-version: ["3.8", "3.9"] #, "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12","3.13"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index 02d5668..a23353c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ coverage.xml # virtual environments /venv* /env* +*.zip +*.stderr.* +/test* diff --git a/PlumedToHTML/PlumedLexer.py b/PlumedToHTML/PlumedLexer.py index 840dbf0..10bf93a 100644 --- a/PlumedToHTML/PlumedLexer.py +++ b/PlumedToHTML/PlumedLexer.py @@ -17,19 +17,19 @@ class PlumedLexer(RegexLexer): (r'(\w+)(=)(__FILL__)', bygroups(Name.Attribute, Text, Literal)), (r'__FILL__', Literal), # Find LABEL=lab - (r'((?i)LABEL)(=)(\S+\b)', bygroups(Name.Attribute, Text, String.Double)), + (r'([Ll][Aa][Bb][Ee][Ll])(=)(\S+\b)', bygroups(Name.Attribute, Text, String.Double)), # Find special replica syntax with fill (r'(\w+)(=)(@\S+:)(__FILL__)', bygroups(Name.Attribute, Text, Name.Constant, Literal)), # Find special replica syntax with brackets around replica command - (r'(\w+)(=\{)(@\S+:)((?s)\{.*?\})(\})', bygroups(Name.Attribute, Text, Name.Constant, Generic, Text)), + (r'(?s)(\w+)(=\{)(@\S+:)(\{.*?\})(\})', bygroups(Name.Attribute, Text, Name.Constant, Generic, Text)), # Find special repliica syntax with multiple brackets - (r'(\w+)(=)(@\S+:)((?s)\{\s*\{.*?\}\s*\})', bygroups(Name.Attribute, Text, Name.Constant, Generic)), + (r'(?s)(\w+)(=)(@\S+:)(\{\s*\{.*?\}\s*\})', bygroups(Name.Attribute, Text, Name.Constant, Generic)), # Find special replica syntax with brackets - (r'(\w+)(=)(@\S+:)((?s)\{.*?\})', bygroups(Name.Attribute, Text, Name.Constant, Generic)), + (r'(?s)(\w+)(=)(@\S+:)(\{.*?\})', bygroups(Name.Attribute, Text, Name.Constant, Generic)), # Find special replica syntax without brackets (r'(\w+)(=)(@\S+:)(\S+\b)', bygroups(Name.Attribute, Text, Name.Constant, Generic)), # Find KEYWORD with {} brackets around value - (r'(\w+)(=)((?s)\{.*?\})', bygroups(Name.Attribute, Text, Generic)), + (r'(?s)(\w+)(=)(\{.*?\})', bygroups(Name.Attribute, Text, Generic)), # Find KEYWORD=whatever with comment immediately after end of whatever (r'(\w+)(=)(\S+)(#.*$)', bygroups(Name.Attribute, Text, Generic, Comment)), # Find KEYWORD=whatever @@ -43,7 +43,7 @@ class PlumedLexer(RegexLexer): # And stuff for long versions of shortcuts (r'(^# PLUMED interprets the command:\n)(#.+$)', bygroups(Comment, Comment.Hashbang)), # Find ENDPLUMED and set everything after it to a comment - (r'(^\s*ENDPLUMED)((?s).*\Z)', bygroups(Keyword, Comment)), + (r'(?s)(^\s*)([Ee][Nn][Dd][Pp][Ll][Uu][Mm][Ee][Dd])(.*\Z)', bygroups(Text, Keyword, Comment)), # Find the start of shortcuts (r'#SHORTCUT.*?\r?\n',Comment.Preproc), # Find the start of a shortcut with a nested default diff --git a/setup.py b/setup.py index 17f690e..11c6979 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,8 @@ "Operating System :: OS Independent", ], install_requires=['lxml','pygments','requests','bs4'], - test_suite='nose.collector', - tests_require=['nose'], + # This adds the assets that PlumedToHTML.get_html_header() asks for () + data_files=[('PlumedToHTML', ['PlumedToHTML/assets/header.html'])], + include_package_data=True, ) +# print(setuptools.find_packages()) \ No newline at end of file diff --git a/tox.ini b/tox.ini index 7ba1242..274b259 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,4 @@ [testenv] -deps = - nose - coverage -commands = nosetests --with-coverage --cover-inclusive --cover-xml +deps = pytest + pytest-cov +commands = pytest --cov=PlumedToHTML --cov-report=term-missing PlumedToHTML/tests