fypp 3.2__tar.gz → 3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. fypp-3.3/.gitignore +10 -0
  2. {fypp-3.2 → fypp-3.3}/PKG-INFO +61 -27
  3. fypp-3.2/src/fypp.egg-info/PKG-INFO → fypp-3.3/README.rst +45 -33
  4. fypp-3.3/pyproject.toml +68 -0
  5. fypp-3.3/src/fypp.py +3512 -0
  6. fypp-3.3/test/include/escaped_includes.inc +1 -0
  7. fypp-3.3/test/include/multi_includes.inc +3 -0
  8. fypp-3.3/test/include/noeol.inc +3 -0
  9. fypp-3.3/test/include/subfolder/need$ #escape.inc +1 -0
  10. fypp-3.3/test/input/filevarroot.fypp +5 -0
  11. {fypp-3.2 → fypp-3.3}/test/runtests.sh +1 -1
  12. {fypp-3.2 → fypp-3.3}/test/test_fypp.py +495 -140
  13. fypp-3.2/CHANGELOG.rst +0 -300
  14. fypp-3.2/MANIFEST.in +0 -6
  15. fypp-3.2/README.rst +0 -263
  16. fypp-3.2/bin/fypp +0 -3088
  17. fypp-3.2/setup.cfg +0 -4
  18. fypp-3.2/setup.py +0 -54
  19. fypp-3.2/src/fypp.egg-info/SOURCES.txt +0 -24
  20. fypp-3.2/src/fypp.egg-info/dependency_links.txt +0 -1
  21. fypp-3.2/src/fypp.egg-info/entry_points.txt +0 -2
  22. fypp-3.2/src/fypp.egg-info/top_level.txt +0 -1
  23. fypp-3.2/src/fypp.py +0 -3088
  24. /fypp-3.2/LICENSE.txt → /fypp-3.3/LICENSE +0 -0
  25. {fypp-3.2 → fypp-3.3}/test/include/assert.inc +0 -0
  26. {fypp-3.2 → fypp-3.3}/test/include/failingmacro.inc +0 -0
  27. {fypp-3.2 → fypp-3.3}/test/include/fypp1.inc +0 -0
  28. {fypp-3.2 → fypp-3.3}/test/include/inimod2.py +0 -0
  29. {fypp-3.2 → fypp-3.3}/test/include/subfolder/fypp2.inc +0 -0
  30. {fypp-3.2 → fypp-3.3}/test/include/subfolder/include_fypp1.inc +0 -0
  31. {fypp-3.2 → fypp-3.3}/test/include/subfolder/include_fypp2.inc +0 -0
  32. {fypp-3.2 → fypp-3.3}/test/inimod.py +0 -0
  33. {fypp-3.2 → fypp-3.3}/test/inimod2.py +0 -0
  34. {fypp-3.2 → fypp-3.3}/test/input/filevarroot.inc +0 -0
fypp-3.3/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ *~
2
+ .idea
3
+ *.pyc
4
+ dist
5
+ build
6
+ docs/_build
7
+ *.egg-info
8
+ .tox
9
+ _gitmsg.saved.txt
10
+
@@ -1,36 +1,32 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.5
2
2
  Name: fypp
3
- Version: 3.2
3
+ Version: 3.3
4
4
  Summary: Python powered Fortran preprocessor
5
- Home-page: https://github.com/aradi/fypp
6
- Author: Bálint Aradi
7
- Author-email: aradi@uni-bremen.de
8
- License: BSD
9
- Keywords: fortran metaprogramming pre-processor
5
+ Project-URL: Homepage, https://fypp.readthedocs.io
6
+ Project-URL: Documentation, https://fypp.readthedocs.io/en/latest/
7
+ Project-URL: Repository, https://github.com/aradi/fypp.git
8
+ Project-URL: Changelog, https://github.com/aradi/fypp/blob/main/CHANGELOG.rst
9
+ Author-email: Bálint Aradi <aradi@uni-bremen.de>
10
+ Maintainer-email: Bálint Aradi <aradi@uni-bremen.de>
11
+ License-Expression: BSD-2-Clause
12
+ License-File: LICENSE
13
+ Keywords: fortran,meta-programming,preprocessor
10
14
  Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Intended Audience :: Developers
15
+ Classifier: Environment :: Console
12
16
  Classifier: Intended Audience :: Science/Research
13
- Classifier: Topic :: Software Development :: Code Generators
14
- Classifier: Topic :: Software Development :: Pre-processors
15
- Classifier: License :: OSI Approved :: BSD License
17
+ Classifier: Operating System :: OS Independent
16
18
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.5
18
- Classifier: Programming Language :: Python :: 3.6
19
- Classifier: Programming Language :: Python :: 3.7
20
- Classifier: Programming Language :: Python :: 3.8
21
- Classifier: Programming Language :: Python :: 3.9
22
- License-File: LICENSE.txt
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/x-rst
23
22
 
24
23
  *********************************************
25
24
  Fypp — Python powered Fortran metaprogramming
26
25
  *********************************************
27
26
 
28
- .. image:: https://travis-ci.org/aradi/fypp.svg?branch=develop
29
- :target: https://travis-ci.org/aradi/fypp
30
-
31
27
  Fypp is a Python powered preprocessor. It can be used for any programming
32
28
  languages but its primary aim is to offer a Fortran preprocessor, which helps to
33
- extend Fortran with condititional compiling and template metaprogramming
29
+ extend Fortran with conditional compiling and template metaprogramming
34
30
  capabilities. Instead of introducing its own expression syntax, it uses Python
35
31
  expressions in its preprocessor directives, offering the consistency and
36
32
  versatility of Python when formulating metaprogramming tasks. It puts strong
@@ -102,18 +98,30 @@ Main features
102
98
 
103
99
  character(*), parameter :: comp_date = "${time.strftime('%Y-%m-%d')}$"
104
100
 
101
+ ! Evaluating python construct as a conditional
102
+ #:if int(time.strftime('%m%d')) == 401
103
+ print *, "April Fools!"
104
+ #:endif
105
+
106
+ with preprocessor variables available as Python variables::
107
+
108
+ #:for plural in [("reds"), ("greens"), ("blues")]
109
+ #:set singular = plural[:-1]
110
+ print *, "Plural of ${singular}$ is ${plural}$"
111
+ #:endfor
112
+
105
113
  * Inclusion of files during preprocessing::
106
114
 
107
115
  #:include "macrodefs.fypp"
108
116
 
109
- * Using Fortran-style continutation lines in preprocessor directives::
117
+ * Using Fortran-style continuation lines in preprocessor directives::
110
118
 
111
119
  #:if var1 > var2 &
112
120
  & or var2 > var4
113
121
  print *, "Doing something here"
114
122
  #:endif
115
123
 
116
- * Passing (unquoted) multiline string arguments to callables::
124
+ * Passing (unquoted) multi-line string arguments to callables::
117
125
 
118
126
  #! Callable needs only string argument
119
127
  #:def DEBUG_CODE(code)
@@ -159,7 +167,7 @@ Main features
159
167
  #:stop 'Negative debug level not allowed!'
160
168
  #:endif
161
169
 
162
- * Easy check for macro parameter sanity::
170
+ * Easily check macro parameter validity::
163
171
 
164
172
  #:def mymacro(RANK)
165
173
  #! Macro only works for RANK 1 and above
@@ -193,7 +201,7 @@ Main features
193
201
  Installing
194
202
  ==========
195
203
 
196
- Fypp needs a working Python 3 interpreter (Python 3.5 or above).
204
+ Fypp needs a working Python 3 interpreter (Python 3.10 or above).
197
205
 
198
206
  When you install Fypp, you obtain the command line tool ``fypp`` and the Python
199
207
  module ``fypp.py``. Latter you can import if you want to access the
@@ -222,8 +230,8 @@ environment), issue ::
222
230
 
223
231
  pip3 install fypp
224
232
 
225
- Alternatively, you can install Fypp into the user space (under `~/.local`) with
226
- ::
233
+ Alternatively, you can install Fypp into the user space (under `~/.local`)
234
+ with ::
227
235
 
228
236
  pip3 install --user fypp
229
237
 
@@ -284,3 +292,29 @@ The behavior of Fypp can be influenced with various command line options. A
284
292
  summary of all command line options can be obtained by::
285
293
 
286
294
  fypp -h
295
+
296
+
297
+ Testing
298
+ =======
299
+
300
+ Fypp can be tested with `tox <https://tox.wiki>`_. Running ::
301
+
302
+ tox
303
+
304
+ in the project root folder builds the package, installs it into a virtual
305
+ environment and runs the unit tests against the installed version. This is done
306
+ for each supported Python version; versions whose interpreter is not available
307
+ on your system are skipped.
308
+
309
+ To test with one Python version only, select the corresponding test
310
+ environment::
311
+
312
+ tox -e 3.14
313
+
314
+ For a quick test during development, you can also run the unit tests directly on
315
+ the source tree with your default ``python3`` interpreter::
316
+
317
+ ./test/runtests.sh
318
+
319
+ To use other interpreters, pass them as arguments (e.g.
320
+ ``./test/runtests.sh python3.12 python3.13``).
@@ -1,36 +1,10 @@
1
- Metadata-Version: 2.1
2
- Name: fypp
3
- Version: 3.2
4
- Summary: Python powered Fortran preprocessor
5
- Home-page: https://github.com/aradi/fypp
6
- Author: Bálint Aradi
7
- Author-email: aradi@uni-bremen.de
8
- License: BSD
9
- Keywords: fortran metaprogramming pre-processor
10
- Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Intended Audience :: Science/Research
13
- Classifier: Topic :: Software Development :: Code Generators
14
- Classifier: Topic :: Software Development :: Pre-processors
15
- Classifier: License :: OSI Approved :: BSD License
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.5
18
- Classifier: Programming Language :: Python :: 3.6
19
- Classifier: Programming Language :: Python :: 3.7
20
- Classifier: Programming Language :: Python :: 3.8
21
- Classifier: Programming Language :: Python :: 3.9
22
- License-File: LICENSE.txt
23
-
24
1
  *********************************************
25
2
  Fypp — Python powered Fortran metaprogramming
26
3
  *********************************************
27
4
 
28
- .. image:: https://travis-ci.org/aradi/fypp.svg?branch=develop
29
- :target: https://travis-ci.org/aradi/fypp
30
-
31
5
  Fypp is a Python powered preprocessor. It can be used for any programming
32
6
  languages but its primary aim is to offer a Fortran preprocessor, which helps to
33
- extend Fortran with condititional compiling and template metaprogramming
7
+ extend Fortran with conditional compiling and template metaprogramming
34
8
  capabilities. Instead of introducing its own expression syntax, it uses Python
35
9
  expressions in its preprocessor directives, offering the consistency and
36
10
  versatility of Python when formulating metaprogramming tasks. It puts strong
@@ -102,18 +76,30 @@ Main features
102
76
 
103
77
  character(*), parameter :: comp_date = "${time.strftime('%Y-%m-%d')}$"
104
78
 
79
+ ! Evaluating python construct as a conditional
80
+ #:if int(time.strftime('%m%d')) == 401
81
+ print *, "April Fools!"
82
+ #:endif
83
+
84
+ with preprocessor variables available as Python variables::
85
+
86
+ #:for plural in [("reds"), ("greens"), ("blues")]
87
+ #:set singular = plural[:-1]
88
+ print *, "Plural of ${singular}$ is ${plural}$"
89
+ #:endfor
90
+
105
91
  * Inclusion of files during preprocessing::
106
92
 
107
93
  #:include "macrodefs.fypp"
108
94
 
109
- * Using Fortran-style continutation lines in preprocessor directives::
95
+ * Using Fortran-style continuation lines in preprocessor directives::
110
96
 
111
97
  #:if var1 > var2 &
112
98
  & or var2 > var4
113
99
  print *, "Doing something here"
114
100
  #:endif
115
101
 
116
- * Passing (unquoted) multiline string arguments to callables::
102
+ * Passing (unquoted) multi-line string arguments to callables::
117
103
 
118
104
  #! Callable needs only string argument
119
105
  #:def DEBUG_CODE(code)
@@ -159,7 +145,7 @@ Main features
159
145
  #:stop 'Negative debug level not allowed!'
160
146
  #:endif
161
147
 
162
- * Easy check for macro parameter sanity::
148
+ * Easily check macro parameter validity::
163
149
 
164
150
  #:def mymacro(RANK)
165
151
  #! Macro only works for RANK 1 and above
@@ -193,7 +179,7 @@ Main features
193
179
  Installing
194
180
  ==========
195
181
 
196
- Fypp needs a working Python 3 interpreter (Python 3.5 or above).
182
+ Fypp needs a working Python 3 interpreter (Python 3.10 or above).
197
183
 
198
184
  When you install Fypp, you obtain the command line tool ``fypp`` and the Python
199
185
  module ``fypp.py``. Latter you can import if you want to access the
@@ -222,8 +208,8 @@ environment), issue ::
222
208
 
223
209
  pip3 install fypp
224
210
 
225
- Alternatively, you can install Fypp into the user space (under `~/.local`) with
226
- ::
211
+ Alternatively, you can install Fypp into the user space (under `~/.local`)
212
+ with ::
227
213
 
228
214
  pip3 install --user fypp
229
215
 
@@ -284,3 +270,29 @@ The behavior of Fypp can be influenced with various command line options. A
284
270
  summary of all command line options can be obtained by::
285
271
 
286
272
  fypp -h
273
+
274
+
275
+ Testing
276
+ =======
277
+
278
+ Fypp can be tested with `tox <https://tox.wiki>`_. Running ::
279
+
280
+ tox
281
+
282
+ in the project root folder builds the package, installs it into a virtual
283
+ environment and runs the unit tests against the installed version. This is done
284
+ for each supported Python version; versions whose interpreter is not available
285
+ on your system are skipped.
286
+
287
+ To test with one Python version only, select the corresponding test
288
+ environment::
289
+
290
+ tox -e 3.14
291
+
292
+ For a quick test during development, you can also run the unit tests directly on
293
+ the source tree with your default ``python3`` interpreter::
294
+
295
+ ./test/runtests.sh
296
+
297
+ To use other interpreters, pass them as arguments (e.g.
298
+ ``./test/runtests.sh python3.12 python3.13``).
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "fypp"
7
+ version = '3.3'
8
+ dependencies = []
9
+ requires-python = ">=3.10"
10
+ authors = [{name = "Bálint Aradi", email = "aradi@uni-bremen.de"},]
11
+ maintainers = [{name = "Bálint Aradi", email = "aradi@uni-bremen.de"},]
12
+ description = "Python powered Fortran preprocessor"
13
+ readme = "README.rst"
14
+ license = "BSD-2-Clause"
15
+ license-files = ["LICENSE"]
16
+ keywords = ["fortran", "meta-programming", "preprocessor"]
17
+ classifiers = [
18
+ "Development Status :: 5 - Production/Stable",
19
+ "Intended Audience :: Science/Research",
20
+ "Programming Language :: Python :: 3",
21
+ "Environment :: Console",
22
+ "Operating System :: OS Independent",
23
+ "Topic :: Scientific/Engineering",
24
+ ]
25
+
26
+ [project.urls]
27
+ Homepage = "https://fypp.readthedocs.io"
28
+ Documentation = "https://fypp.readthedocs.io/en/latest/"
29
+ Repository = "https://github.com/aradi/fypp.git"
30
+ Changelog = "https://github.com/aradi/fypp/blob/main/CHANGELOG.rst"
31
+
32
+ [project.scripts]
33
+ fypp = "fypp:run_fypp"
34
+
35
+ # Hatch builder settings
36
+
37
+ [tool.hatch.build.targets.wheel]
38
+ packages = ["src/fypp.py"]
39
+
40
+ [tool.hatch.build.targets.sdist]
41
+ include = ["src", "test"]
42
+
43
+ # Tox settings
44
+
45
+ [tool.tox]
46
+ requires = ["tox>=4.40"]
47
+ env_list = ["3.15", "3.14", "3.13", "3.12", "3.11", "3.10"]
48
+
49
+ [tool.tox.env_run_base]
50
+ description = "Run unit tests across Python environments"
51
+ skip_missing_interpreters = true
52
+ package = "sdist-wheel"
53
+ wheel_build_env = ".pkg"
54
+ changedir = "{tox_root}/test"
55
+ commands= [
56
+ ["{env_python}", "-m", "unittest", "discover"]
57
+ ]
58
+
59
+ # Black settings
60
+
61
+ [tool.black]
62
+ line-length = 100
63
+ target-version = ["py310", "py311", "py312", "py313", "py314"]
64
+
65
+ # Typos settings
66
+
67
+ [tool.typos.default.extend-words]
68
+ BA = "BA"