Skip to content

Muskam09/py-task-guideline

 
 

Repository files navigation

Guideline how to implement solution for Python tasks

Prepare the project

  1. Fork the repo (GitHub repository)
  2. Clone the forked repo
    git clone the-link-from-your-forked-repo
    
    • You can get the link by clicking the Clone or download button in your repo
  3. Open the project folder in your IDE
  4. Open a terminal in the project folder
  5. Create a branch for the solution and switch on it
    git checkout -b develop
    
    • You can use any other name instead of develop
  6. If you are using PyCharm - it may propose you to automatically create venv for your project and install requirements in it, but if not:
    python -m venv venv
    venv\Scripts\activate (on Windows)
    source venv/bin/activate (on macOS)
    pip install -r requirements.txt
    

Implement the solution

  1. Implement the solution within a function in app/main.py Where to write a solution
  2. Run pytest to check if your solution is correct (from command line, or using PyCharm pytest support)
    • If at least one test fails fix the solution and check again.
  3. Run flake8 to see if your code follows the flake8 rules
    • If you see some errors fix them and check again
  4. Save the solution
    git commit -am 'Solution'
    
  5. Push the solution to the repo
    git push origin develop
    
    • If you created another branch (not develop) use its name instead

Note: if changes were added to GitHub task when you already forked it and downloaded to your local machine, follow this guideline to pull changes.

Create a Pull Request (PR)

  1. Open your repo on GitHub and create a Pull Request (PR) New PR button
  2. Select your branch in the dropdown! Create PR button
  3. Verify the PR details and code (scroll down to see it) and confirm Create PR confirmation

If a mentor requested changes on your PR

  1. Repeat Implement the solution section
  2. PR is updated automatically after a push to your branch on GitHub

After updating your PR - click on re-request button at PR page IF YOU NEED ADDITIONAL REVIEW OF YOUR CODE. Image of re-request button

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published