Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Makefile to automate common command-line tasks #431

Open
1 task done
Raruto opened this issue Dec 21, 2022 · 0 comments · May be fixed by #436
Open
1 task done

Add a Makefile to automate common command-line tasks #431

Raruto opened this issue Dec 21, 2022 · 0 comments · May be fixed by #436
Assignees
Labels
feature New feature or request

Comments

@Raruto
Copy link
Contributor

Raruto commented Dec 21, 2022

Checklist

  • I've searched through the current issues to make sure this feature hasn't been requested already.

Motivation

As per v3.5,

these are some files that include development scripts that can be found in the source code bundle:

paver

yarn / npm

docker-compose

manage.py

Some of the issues to report with the current structure:

  • each of these commands requires specific tools and knowledge for the developer to find, understand and use them *
  • when using different tools it is difficult to have an overview on the available scripts (or at least the most useful ones) and where it is recommended to code to simplify some development tasks (e.g. versioning, virtualenv, ...) **
  • too much freedom for the final developers in writing output logs for bash scripts (eg. it's not always so easy to understand if and when a task is executed) ***

* ref: g3w-suite/g3w-suite-docker#75, #352, #419, #434

** ref: g3w-suite/g3w-client#112

*** ref: #373

Suggested solution

Use a Makefile in order to make writing administrative tasks independent of the tool and language needed to run it.

In particular we could start with:

  1. remove paver as project dependency and convert all pavement.py tasks (which are already almost bash commands) into Makefile directives
  2. remove or simplify build_suite.sh and setup_suite.sh by calling Makefile directives within those files
  3. update the contributing section within project's README.md or as seperated file (ref: Add how to develop section within README.md #380) for people who don't want to use docker to develop

Below a sample project from which we can get inspiration:

Alternatives considered

Python Project Scripts

ref: Python Project Scripts

PyPA specs states that we can install scripts locally (python only? I didn't investigate in depth) when resolving project dependencies (e.g. while a pip install .).

This type of solution should be easily integrated with all the build tools present in the python world (e.g. poetry), but also directly via a regular python install using adding a pyproject.toml file to your project (here a sample pyproject on which you can experiment with adding a project script thus defined).

On the other hand:

  • a Makefile shouldn't need any further dependencies to work (to be updated and configured)
  • the make command is quite straightforward and is generally already available in many Linux installations
  • the make command does not need to create dedicated environments before starting a directive (ref. virtualenv for python projects)

NB all the considerations above are to be taken with the right caution, at the moment I have not investigated whether through the use of a python package manager (there are really too many) it could be simpler than a simple Makefile.

@Raruto Raruto added the feature New feature or request label Dec 21, 2022
@Raruto Raruto assigned Raruto and unassigned wlorenzetti Jan 3, 2023
@Raruto Raruto linked a pull request Jan 3, 2023 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants