-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
…on of 2 scripts for installing the project.
PROJECT-SETUP.sh
Outdated
There was a problem hiding this comment.
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:
- For users without Git installed: The script would fail, as cloning relies on Git being present.
- 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
-
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.
-
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
).
- To maintain consistency, I suggest adopting the
PROJECT-SETUP.sh
Outdated
# Clone the repository in the current directory | ||
git clone https://github.com/nickpadd/EuropeanFootballLeaguePredictor | ||
|
||
# Browse the project directory | ||
cd EuropeanFootballLeaguePredictor || exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EFLPvenv/bin/pip install -r requirements.txt | |
eflp_venv/bin/pip install -r requirements.txt |
README.md
Outdated
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 | ||
``` |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bash PROJECT-SETUP.sh | |
bash run_project_setup.sh |
README.md
Outdated
``` | ||
- Windows users | ||
```bash | ||
PROJECT-SETUP.bat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source EFLPvenv/bin/activate | |
source eflp_venv/bin/activate |
README.md
Outdated
``` | ||
- Windows users | ||
```bash | ||
EFLPvenv\Scripts\activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EFLPvenv\Scripts\activate | |
eflp_venv\Scripts\activate |
PROJECT-SETUP.bat
Outdated
There was a problem hiding this comment.
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!
There was a problem hiding this 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:
-
Naming Conventions: I suggest using
snake_case
for directory and script names to maintain consistency and follow common conventions. Additionally, including therun
keyword in user-facing scripts (e.g.,run_setup.sh
) makes their purpose clearer. -
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.
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:
Possible improvements to my contribution:
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.