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

Setting up the project #82

Closed
wants to merge 3 commits into from

Conversation

MichaHllx
Copy link
Contributor

@MichaHllx MichaHllx commented Nov 21, 2024

Creation of a batch script (.bat) that runs under Windows using the command prompt (not for PowerShell, possible improvement).
Creation of a bash script (.sh) that runs on Linux and macOS. This script works with the zsh shell and the bash shell.

Advantages:

  • The user has virtually nothing to do thanks to the script.
  • The readme is easier to understand and more compact.
  • If an error is reported, it's easier to understand what the problem is because all users will do exactly the same thing (i.e. run the script). So it's easier to understand where the problem is coming from.
  • The dependencies are centralised in one place.

Possible improvements to my contribution:

  • Develop a script that works with the new Windows PowerShell.
  • Set up a tutorial to install the correct version of python if necessary (for beginners).
  • Find a way to solve the problem of the single dependency that requires a very restrictive version of python.

In conclusion, I think and hope that this contribution will solve some of the problems that users had. In any case, I think it will help users who are less at ease with the domain. And I also hope that it will make maintenance work easier afterwards for the developer.

@MichaHllx MichaHllx closed this Nov 21, 2024
@MichaHllx MichaHllx reopened this Nov 21, 2024
PROJECT-SETUP.sh Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe having the user independently download the .sh file to clone the repository and install dependencies might introduce some confusion. Here’s why:

  1. For users without Git installed: The script would fail, as cloning relies on Git being present.
  2. For experienced users: It’s more intuitive to clone the repository themselves and then run the script from within the project directory. Running the script as is would result in the repository being cloned twice.

Suggested Changes

  1. Simplify the Workflow:

    • Assume users will first clone the repository manually (we should provide clear instructions for it). Then, the script can focus solely on setting up the environment and dependencies within the cloned project directory.
  2. Consistent Naming:

    • To maintain consistency, I suggest adopting the snake_case naming convention for directories and files.
    • Scripts intended for user interaction could include the run keyword, making their purpose clearer (e.g., run_setup.sh).

PROJECT-SETUP.sh Outdated
Comment on lines 40 to 44
# Clone the repository in the current directory
git clone https://github.com/nickpadd/EuropeanFootballLeaguePredictor

# Browse the project directory
cd EuropeanFootballLeaguePredictor || exit
Copy link
Owner

@nickpadd nickpadd Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Clone the repository in the current directory
git clone https://github.com/nickpadd/EuropeanFootballLeaguePredictor
# Browse the project directory
cd EuropeanFootballLeaguePredictor || exit

PROJECT-SETUP.sh Outdated
cd EuropeanFootballLeaguePredictor || exit

# Create a virtual environment
$PYTHON -m venv EFLPvenv
Copy link
Owner

@nickpadd nickpadd Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$PYTHON -m venv EFLPvenv
$PYTHON -m venv eflp_venv

PROJECT-SETUP.sh Outdated
$PYTHON -m venv EFLPvenv

# Activate the virtual environment
source EFLPvenv/bin/activate
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source EFLPvenv/bin/activate
source eflp_venv/bin/activate

PROJECT-SETUP.sh Outdated
source EFLPvenv/bin/activate

# Install dependencies for the project using the pip associated with the virtual environment
EFLPvenv/bin/pip install -r requirements.txt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
EFLPvenv/bin/pip install -r requirements.txt
eflp_venv/bin/pip install -r requirements.txt

README.md Outdated
Comment on lines 18 to 30
1. Clone this repository to your local machine or download the project files.
### Haven’t installed the project yet? Time to dive in!

```bash
git clone https://github.com/nickpadd/EuropeanFootballLeaguePredictor

2. Navigate to the project directory using the command line.
```bash
cd EuropeanFootballLeaguePredictor

- Managing dependencies with Poetry:
- Installing poetry:
```bash
pip install poetry
```
- Installing project dependencies:
```bash
poetry install
```
1. Download the file *PROJECT-SETUP.sh* (**or the '.bat' for Windows users**) from the repository and place it in the
folder where you want to install the project.
2. Open the terminal and navigate to the folder where the 'PROJECT-SETUP.sh' file is located.
3. Run the following command in the terminal:
- macOS/Linux users
```bash
bash PROJECT-SETUP.sh
```
- Windows users
```bash
PROJECT-SETUP.bat
```
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the .sh and .bat scripts are modified to exclude the cloning procedure, these lines should explicitly specify the steps for cloning the repository.

README.md Outdated
3. Run the following command in the terminal:
- macOS/Linux users
```bash
bash PROJECT-SETUP.sh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bash PROJECT-SETUP.sh
bash run_project_setup.sh

README.md Outdated
```
- Windows users
```bash
PROJECT-SETUP.bat
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PROJECT-SETUP.bat
run_project_setup.bat

README.md Outdated
2. Run the following command in the terminal:
- macOS/Linux users
```bash
source EFLPvenv/bin/activate
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source EFLPvenv/bin/activate
source eflp_venv/bin/activate

README.md Outdated
```
- Windows users
```bash
EFLPvenv\Scripts\activate
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
EFLPvenv\Scripts\activate
eflp_venv\Scripts\activate

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest the same changes as in the .sh script, as well as changing the name to run_project_setup.bat for consistency!

Copy link
Owner

@nickpadd nickpadd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I have left a few comments, primarily regarding naming convention changes and workflow improvements. Specifically:

  1. Naming Conventions: I suggest using snake_case for directory and script names to maintain consistency and follow common conventions. Additionally, including the run keyword in user-facing scripts (e.g., run_setup.sh) makes their purpose clearer.

  2. Cloning Workflow: If the .sh and .bat scripts are modified to exclude repository cloning, ensure the documentation or script comments provide clear instructions for users to manually clone the repository before running the setup scripts. This avoids confusion and unnecessary duplication.

Once these changes are addressed, I’ll be happy to approve and merge.

@MichaHllx MichaHllx requested a review from nickpadd November 24, 2024 13:46
@MichaHllx MichaHllx closed this Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants