From 032e9a398b77437496223037101b0763788fd60d Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Sun, 21 Nov 2021 13:29:38 -0500 Subject: [PATCH] Move all the diffuse package in its own directory This helps the linters (pylint and flake8) --- .github/workflows/main.yml | 2 +- .pylintrc | 2 +- src/{ => diffuse}/__init__.py | 0 src/{ => diffuse}/constants.py.in | 0 src/{ => diffuse}/dialogs.py | 0 src/{ => diffuse}/diffuse.in | 0 src/{ => diffuse}/main.py | 0 src/diffuse/meson.build | 46 +++++++++++++++++++++++++ src/{ => diffuse}/preferences.py | 0 src/{ => diffuse}/resources.py | 0 src/{ => diffuse}/utils.py | 0 src/{ => diffuse}/vcs/__init__.py | 0 src/{ => diffuse}/vcs/bzr.py | 0 src/{ => diffuse}/vcs/cvs.py | 0 src/{ => diffuse}/vcs/darcs.py | 0 src/{ => diffuse}/vcs/folder_set.py | 0 src/{ => diffuse}/vcs/git.py | 0 src/{ => diffuse}/vcs/hg.py | 0 src/{ => diffuse}/vcs/mtn.py | 0 src/{ => diffuse}/vcs/rcs.py | 0 src/{ => diffuse}/vcs/svk.py | 0 src/{ => diffuse}/vcs/svn.py | 0 src/{ => diffuse}/vcs/vcs_interface.py | 0 src/{ => diffuse}/vcs/vcs_registry.py | 0 src/{ => diffuse}/widgets.py | 0 src/meson.build | 47 +------------------------- 26 files changed, 49 insertions(+), 48 deletions(-) rename src/{ => diffuse}/__init__.py (100%) rename src/{ => diffuse}/constants.py.in (100%) rename src/{ => diffuse}/dialogs.py (100%) rename src/{ => diffuse}/diffuse.in (100%) rename src/{ => diffuse}/main.py (100%) create mode 100644 src/diffuse/meson.build rename src/{ => diffuse}/preferences.py (100%) rename src/{ => diffuse}/resources.py (100%) rename src/{ => diffuse}/utils.py (100%) rename src/{ => diffuse}/vcs/__init__.py (100%) rename src/{ => diffuse}/vcs/bzr.py (100%) rename src/{ => diffuse}/vcs/cvs.py (100%) rename src/{ => diffuse}/vcs/darcs.py (100%) rename src/{ => diffuse}/vcs/folder_set.py (100%) rename src/{ => diffuse}/vcs/git.py (100%) rename src/{ => diffuse}/vcs/hg.py (100%) rename src/{ => diffuse}/vcs/mtn.py (100%) rename src/{ => diffuse}/vcs/rcs.py (100%) rename src/{ => diffuse}/vcs/svk.py (100%) rename src/{ => diffuse}/vcs/svn.py (100%) rename src/{ => diffuse}/vcs/vcs_interface.py (100%) rename src/{ => diffuse}/vcs/vcs_registry.py (100%) rename src/{ => diffuse}/widgets.py (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0e303a..052629f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: - name: Pylint uses: cclauss/GitHub-Action-for-pylint@master with: - args: "pylint src/vcs/ src/dialogs.py src/preferences.py src/resources.py src/utils.py src/widgets.py" + args: "pylint src/**/*.py" meson-build-test: runs-on: ubuntu-latest diff --git a/.pylintrc b/.pylintrc index f407186..3a709f6 100644 --- a/.pylintrc +++ b/.pylintrc @@ -24,7 +24,7 @@ ignore=CVS # Add files or directories matching the regex patterns to the ignore-list. The # regex matches against paths. -ignore-paths= +ignore-paths=src/diffuse/main.py # Files or directories matching the regex patterns are skipped. The regex # matches against base names, not paths. diff --git a/src/__init__.py b/src/diffuse/__init__.py similarity index 100% rename from src/__init__.py rename to src/diffuse/__init__.py diff --git a/src/constants.py.in b/src/diffuse/constants.py.in similarity index 100% rename from src/constants.py.in rename to src/diffuse/constants.py.in diff --git a/src/dialogs.py b/src/diffuse/dialogs.py similarity index 100% rename from src/dialogs.py rename to src/diffuse/dialogs.py diff --git a/src/diffuse.in b/src/diffuse/diffuse.in similarity index 100% rename from src/diffuse.in rename to src/diffuse/diffuse.in diff --git a/src/main.py b/src/diffuse/main.py similarity index 100% rename from src/main.py rename to src/diffuse/main.py diff --git a/src/diffuse/meson.build b/src/diffuse/meson.build new file mode 100644 index 0000000..b731de1 --- /dev/null +++ b/src/diffuse/meson.build @@ -0,0 +1,46 @@ +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +moduledir = join_paths(pkgdatadir, 'diffuse') +sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir')) + +python = import('python') + +conf = configuration_data() +conf.set('PYTHON', python.find_installation('python3').path()) +conf.set('pkgdatadir', pkgdatadir) +conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir'))) + +configure_file( + input: 'diffuse.in', + output: 'diffuse', + configuration: conf, + install: true, + install_dir: get_option('bindir') +) + +conf = configuration_data() +conf.set('VERSION', meson.project_version()) +conf.set('sysconfigdir', sysconfdir) +conf.set('log_print_output', get_option('log_print_output')) +conf.set('log_print_stack', get_option('log_print_stack')) +conf.set('use_flatpak', get_option('use_flatpak')) + +configure_file( + input: 'constants.py.in', + output: 'constants.py', + configuration: conf, + install: true, + install_dir: moduledir +) + +diffuse_sources = [ + '__init__.py', + 'dialogs.py', + 'main.py', + 'preferences.py', + 'resources.py', + 'utils.py', + 'widgets.py', +] + +install_data(diffuse_sources, install_dir: moduledir) +install_subdir('vcs', install_dir: moduledir, strip_directory: false) diff --git a/src/preferences.py b/src/diffuse/preferences.py similarity index 100% rename from src/preferences.py rename to src/diffuse/preferences.py diff --git a/src/resources.py b/src/diffuse/resources.py similarity index 100% rename from src/resources.py rename to src/diffuse/resources.py diff --git a/src/utils.py b/src/diffuse/utils.py similarity index 100% rename from src/utils.py rename to src/diffuse/utils.py diff --git a/src/vcs/__init__.py b/src/diffuse/vcs/__init__.py similarity index 100% rename from src/vcs/__init__.py rename to src/diffuse/vcs/__init__.py diff --git a/src/vcs/bzr.py b/src/diffuse/vcs/bzr.py similarity index 100% rename from src/vcs/bzr.py rename to src/diffuse/vcs/bzr.py diff --git a/src/vcs/cvs.py b/src/diffuse/vcs/cvs.py similarity index 100% rename from src/vcs/cvs.py rename to src/diffuse/vcs/cvs.py diff --git a/src/vcs/darcs.py b/src/diffuse/vcs/darcs.py similarity index 100% rename from src/vcs/darcs.py rename to src/diffuse/vcs/darcs.py diff --git a/src/vcs/folder_set.py b/src/diffuse/vcs/folder_set.py similarity index 100% rename from src/vcs/folder_set.py rename to src/diffuse/vcs/folder_set.py diff --git a/src/vcs/git.py b/src/diffuse/vcs/git.py similarity index 100% rename from src/vcs/git.py rename to src/diffuse/vcs/git.py diff --git a/src/vcs/hg.py b/src/diffuse/vcs/hg.py similarity index 100% rename from src/vcs/hg.py rename to src/diffuse/vcs/hg.py diff --git a/src/vcs/mtn.py b/src/diffuse/vcs/mtn.py similarity index 100% rename from src/vcs/mtn.py rename to src/diffuse/vcs/mtn.py diff --git a/src/vcs/rcs.py b/src/diffuse/vcs/rcs.py similarity index 100% rename from src/vcs/rcs.py rename to src/diffuse/vcs/rcs.py diff --git a/src/vcs/svk.py b/src/diffuse/vcs/svk.py similarity index 100% rename from src/vcs/svk.py rename to src/diffuse/vcs/svk.py diff --git a/src/vcs/svn.py b/src/diffuse/vcs/svn.py similarity index 100% rename from src/vcs/svn.py rename to src/diffuse/vcs/svn.py diff --git a/src/vcs/vcs_interface.py b/src/diffuse/vcs/vcs_interface.py similarity index 100% rename from src/vcs/vcs_interface.py rename to src/diffuse/vcs/vcs_interface.py diff --git a/src/vcs/vcs_registry.py b/src/diffuse/vcs/vcs_registry.py similarity index 100% rename from src/vcs/vcs_registry.py rename to src/diffuse/vcs/vcs_registry.py diff --git a/src/widgets.py b/src/diffuse/widgets.py similarity index 100% rename from src/widgets.py rename to src/diffuse/widgets.py diff --git a/src/meson.build b/src/meson.build index b731de1..1e252f9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,46 +1 @@ -pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) -moduledir = join_paths(pkgdatadir, 'diffuse') -sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir')) - -python = import('python') - -conf = configuration_data() -conf.set('PYTHON', python.find_installation('python3').path()) -conf.set('pkgdatadir', pkgdatadir) -conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir'))) - -configure_file( - input: 'diffuse.in', - output: 'diffuse', - configuration: conf, - install: true, - install_dir: get_option('bindir') -) - -conf = configuration_data() -conf.set('VERSION', meson.project_version()) -conf.set('sysconfigdir', sysconfdir) -conf.set('log_print_output', get_option('log_print_output')) -conf.set('log_print_stack', get_option('log_print_stack')) -conf.set('use_flatpak', get_option('use_flatpak')) - -configure_file( - input: 'constants.py.in', - output: 'constants.py', - configuration: conf, - install: true, - install_dir: moduledir -) - -diffuse_sources = [ - '__init__.py', - 'dialogs.py', - 'main.py', - 'preferences.py', - 'resources.py', - 'utils.py', - 'widgets.py', -] - -install_data(diffuse_sources, install_dir: moduledir) -install_subdir('vcs', install_dir: moduledir, strip_directory: false) +subdir('diffuse')