Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into mpi_omp_support
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Nov 19, 2024
2 parents 788e75a + 30488bf commit 6fd7a4d
Show file tree
Hide file tree
Showing 70 changed files with 206 additions and 2,488 deletions.
62 changes: 35 additions & 27 deletions source/fab/tools/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,40 @@
# For further details please refer to the file COPYRIGHT
# which you should have received as part of this distribution
##############################################################################

"""This file contains the base class for versioning tools like git and
subversion. It also contains derived classes Git, Subversion, and Fcm.
"""

Versioning tools such as Subversion and Git.
"""
from abc import ABC
from pathlib import Path
from typing import Dict, List, Optional, Union

from fab.tools.category import Category
from fab.tools.tool import Tool


class Versioning(Tool):
'''This is the base class for versioning tools like git and svn.
:param name: the name of the tool.
:param exec_name: the name of the executable of this tool.
:param category: the category to which this tool belongs).
'''

class Versioning(Tool, ABC):
"""
Base class for versioning tools like Git and Subversion.
"""
def __init__(self, name: str,
exec_name: Union[str, Path],
category: Category):
"""
Constructor.
:param name: Display name of this tool.
:param exec_name: Executable for this tool.
:param category: Tool belongs to this category.
"""
super().__init__(name, exec_name, category,
availablility_option="help")


# =============================================================================
class Git(Versioning):
'''This is the base class for git.
'''
"""
Interface to Git version control system.
"""

def __init__(self):
super().__init__("git", "git",
Expand Down Expand Up @@ -111,20 +114,23 @@ def merge(self, dst: Union[str, Path],

# =============================================================================
class Subversion(Versioning):
'''This is the base class for subversion. Note that this is also the
base class for FCM, so it allows overwriting name, exec_name and
category, but will default to use svn.
:param name: name of the tool, defaults to subversion.
:param exec_name: name of the executable, defaults to "svn".
:param category: the category, FCM or SUBVERSION (the latter is
the default)
'''

"""
Interface to the Subversion version control system.
"""
def __init__(self, name: Optional[str] = None,
exec_name: Optional[Union[str, Path]] = None,
category: Category = Category.SUBVERSION):
name = name or "subversion"
"""
Constructor.
This is class is extended by the FCM interface which is why name and
executable are mutable.
:param name: Tool name, defaults to "subversion."
:param exec_name: Tool executable, defaults to "svn."
:param category: Tool category, defaults to SUBVERSION.
"""
name = name or "Subversion"
exec_name = exec_name or "svn"
super().__init__(name, exec_name, category=category)

Expand Down Expand Up @@ -166,7 +172,9 @@ def export(self, src: Union[str, Path],
:param dst: destination path.
:param revision: revision to export.
'''
self.execute(['export', '--force'], revision, [str(src), str(dst)])
self.execute(['export', '--force'],
revision,
[str(src), str(dst)])

def checkout(self, src: Union[str, Path],
dst: Union[str, Path],
Expand Down Expand Up @@ -214,4 +222,4 @@ class Fcm(Subversion):
'''

def __init__(self):
super().__init__("fcm", "fcm", Category.FCM)
super().__init__("FCM", "fcm", Category.FCM)
33 changes: 0 additions & 33 deletions tests-old/TestCases/CompiletimeDependency/Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions tests-old/TestCases/CompiletimeDependency/bisto.h

This file was deleted.

20 changes: 0 additions & 20 deletions tests-old/TestCases/CompiletimeDependency/hillfort.F90

This file was deleted.

17 changes: 0 additions & 17 deletions tests-old/TestCases/CompiletimeDependency/looper.c

This file was deleted.

6 changes: 0 additions & 6 deletions tests-old/TestCases/CompiletimeDependency/oxo.h

This file was deleted.

21 changes: 0 additions & 21 deletions tests-old/TestCases/CompiletimeDependency/support_mod.f90

This file was deleted.

56 changes: 0 additions & 56 deletions tests-old/TestCases/CompiletimeDependency/with-beef.mk

This file was deleted.

55 changes: 0 additions & 55 deletions tests-old/TestCases/CompiletimeDependency/without-beef.mk

This file was deleted.

8 changes: 0 additions & 8 deletions tests-old/TestCases/FortranSourceTree/ReadMe

This file was deleted.

23 changes: 0 additions & 23 deletions tests-old/TestCases/FortranSourceTree/fpp_one.f90

This file was deleted.

23 changes: 0 additions & 23 deletions tests-old/TestCases/FortranSourceTree/fpp_two.f90

This file was deleted.

Loading

0 comments on commit 6fd7a4d

Please sign in to comment.