easyPythonpi is a beginner-friendly Python library that focuses on simple calculations. It's designed to encourage open-source contributions, making it an ideal project for newcomers to programming and open source.
🔍 Fork the Repository
- Fork this repository by clicking the "Fork" button in the top-right corner of this page. Alternatively, you can fork it directly from here.
📥 Clone the Repository
-
Clone your forked repository to your local computer using the following command. Replace
url_you_just_copied
with the URL of your forked repository.git clone url_you_just_copied
📂 Open the Repository
-
Open the cloned repository in your preferred code editor. Additionally, open a terminal within the repository directory.
cd easyPythonpi
🌿 Create a New Branch
-
Create a new branch for your changes. Replace
username
with your GitHub username in the following command:git checkout -b username
🚀 Contribute Code
-
Add your new methods or functions to the
easyPythonpi.py
file within the codebase. Ensure that your code adheres to the coding style and conventions used in the existing code for consistency. For example:def calculate_average(numbers): """Calculate the average of a list of numbers.""" if len(numbers) == 0: return 0 return sum(numbers) / len(numbers)
📝 Commit Your Changes
-
Once you've added your code, commit your changes to GitHub using the following commands. Make sure you execute them in the precise order, one after another, in your terminal.
# Stage your changes git add . # Commit your changes with a descriptive message git commit -m "Hacktoberfest contribution" # Push your changes to your GitHub repository git push -u origin your_github_username
📢 Open a Pull Request
-
Navigate to your forked repository on GitHub. You'll see a yellow box at the top indicating that some changes have been pushed. Click the "Compare & pull request" button.
-
Submit your pull request by adding a title and description. Congratulations, you have successfully opened a pull request in this repository.
Note: To complete the Hacktoberfest challenge, you need to open four valid pull requests. If you've followed the above steps, you've already opened one pull request, and you need three more.
To ensure the reliability of your contributions and modifications, it's important to run test cases for the easyPythonpi library.
Before running the test cases, ensure you have the following prerequisites installed on your system:
- Python: The Python programming language.
🧪 Run Test Cases
-
Install the required dependencies using pip:
pip install -r requirements.txt
-
Navigate to the project directory in your terminal.
-
Run the test suite:
python tests.py
The test suite will execute, and you'll see the test results in your terminal. Ensure that all tests pass before making any contributions or modifications.
Working in a virtual environment is a good practice as it isolates project dependencies from your global Python environment.
🔮 Prerequisites
Before setting up a virtual environment, ensure you have Python installed on your system.
📦 Install and Activate a Virtual Environment
-
Create a virtual environment (you can replace
venv
with your preferred environment name):python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS and Linux:
source venv/bin/activate
-
-
Install
unittest
(if not already installed):pip install unittest
🔬 Run the Test Cases within the Virtual Environment
- Run the test cases as mentioned above.
🔓 Deactivate the Virtual Environment (when done)
-
When you're finished working on the project, deactivate the virtual environment:
deactivate
Repositories with the hacktoberfest
label are considered for the Hacktoberfest challenge. Your contributions to this project can help you achieve your Hacktoberfest goals.
Thank you for contributing to the open-source community!