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

Implement Standard Library #2

Draft
wants to merge 119 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
763fe90
Add Python requirements file
dl1998 Sep 1, 2023
cbc1b9d
Add Sphinx configuration
dl1998 Sep 1, 2023
a5a408d
Add sources folder
dl1998 Sep 1, 2023
9c95e77
Add tests folder
dl1998 Sep 1, 2023
d414600
Update commit variable in Branch class
dl1998 Sep 1, 2023
eae6104
Add PyLinter
dl1998 Sep 1, 2023
e5643f5
Add setup.py
dl1998 Sep 1, 2023
fcd669d
Add changelog file
dl1998 Sep 1, 2023
51f58fc
Update README.md
dl1998 Sep 30, 2023
90f8b96
Update PyLinter configuration
dl1998 Sep 30, 2023
979e886
Update base class for GitCommand
dl1998 Sep 30, 2023
c20c703
Update PullCommandDefinitions class to be compliant with the base class
dl1998 Sep 30, 2023
4ceb98e
Add a new class with definition of the 'git add' command
dl1998 Sep 30, 2023
8dc2a58
Add a new class with definition of the 'git clone' command
dl1998 Sep 30, 2023
abf26f1
Add a new class with definition of the 'git for-each-ref' command
dl1998 Sep 30, 2023
f274075
Add a new class with definition of the 'git init' command
dl1998 Sep 30, 2023
f2d8ca7
Add a new class with definition of the 'git log' command
dl1998 Sep 30, 2023
8a15aa7
Add a new class with definition of the 'git mv' command
dl1998 Sep 30, 2023
c8494fe
Add a new class with definition of the 'git push' command
dl1998 Sep 30, 2023
cf11c51
Add a new class with definition of the 'git rm' command
dl1998 Sep 30, 2023
47a54e4
Add a new class with definition of the 'git show' command
dl1998 Sep 30, 2023
8c4bb52
Add .DS_Store file to the .gitignore
dl1998 Sep 30, 2023
e76275c
Add a new class for manipulations with the paths
dl1998 Sep 30, 2023
c43811e
Uncomment .idea exclude
dl1998 Sep 30, 2023
465a6af
Add submodule for git object models
dl1998 Sep 30, 2023
b177b3c
Add common model classes
dl1998 Sep 30, 2023
c3532e6
Add models for the git branches
dl1998 Sep 30, 2023
34726c6
Add models for the git commits
dl1998 Sep 30, 2023
a751e62
Add models for the git remotes
dl1998 Sep 30, 2023
4e8a93c
Add model for the git repository paths
dl1998 Sep 30, 2023
b91cf4f
Add models for the git tags
dl1998 Sep 30, 2023
78c439a
Add submodule for git objects parsers
dl1998 Sep 30, 2023
ceba40c
Add a new parser for the git branches
dl1998 Sep 30, 2023
5d554f3
Add a new parser for the git commits
dl1998 Sep 30, 2023
bd86163
Add a new parser for the git commits
dl1998 Sep 30, 2023
7d436ee
Extend git command runner functionality
dl1998 Sep 30, 2023
3c312ac
Update main classes to work with recent changes
dl1998 Sep 30, 2023
96dc1c6
Refactor documentation modules
dl1998 Sep 30, 2023
420ed63
Add docs/build to .gitignore list
dl1998 Sep 30, 2023
3675492
Change typing for commit parent on Optional[Commit]
dl1998 Sep 30, 2023
475675d
Update docstring for create_from_value method
dl1998 Sep 30, 2023
f9d9366
Update python requirements list
dl1998 Sep 30, 2023
7229237
Update setup.py configuration
dl1998 Sep 30, 2023
5e202f3
Add GitHub configuration files
dl1998 Sep 30, 2023
d9a0be6
Update repository name
dl1998 Sep 30, 2023
52a6849
Fix issues in add and rm commands
dl1998 Sep 30, 2023
5d8abe2
Minor code cleanup
dl1998 Sep 30, 2023
afb0009
Change LICENSE file extension
dl1998 Sep 30, 2023
c78bf1f
Add tests for git init, git clone, and git mv commands
dl1998 Oct 1, 2023
82805e6
Update PathsMapping to set default root path
dl1998 Oct 1, 2023
a90be71
Extend GitConfig functionality
dl1998 Oct 1, 2023
ebd84db
Add a new class with definition of the 'git config' command
dl1998 Oct 1, 2023
497e5d1
Update GitRepository class to use ConfigCommandDefinitions
dl1998 Oct 1, 2023
34002ef
Add method for saving changes in the GitIgnore
dl1998 Oct 1, 2023
da38dbc
Add docstrings to GitConfig class
dl1998 Oct 1, 2023
e488d16
Resolve minor pylint warnings
dl1998 Oct 1, 2023
e212c43
Add docstrings to GitIgnore class
dl1998 Oct 1, 2023
2f20618
Add classes to handle option name aliases
dl1998 Oct 1, 2023
1e46ffb
Extend git options definitions to use option name aliases
dl1998 Oct 1, 2023
3f5a95e
Add docstrings and typing to FilesChangesHandler
dl1998 Oct 1, 2023
d142a5d
Remove old redundant constants that has been moved to TagsParser
dl1998 Oct 1, 2023
266ff5b
Update typing for the raw_tags in the docstring
dl1998 Oct 1, 2023
0b612c0
Add exceptions for the git commands: show, config, and checkout
dl1998 Oct 1, 2023
02d6f7d
Fix docstrings
dl1998 Oct 1, 2023
3f60786
Add a new class with definition of the 'git checkout' command
dl1998 Oct 1, 2023
8a19a7f
Remove autogenerated .rst files
dl1998 Oct 1, 2023
20f8a0f
Add an exception class for 'git for-each-ref' command
dl1998 Oct 1, 2023
ecf76a5
Add an exception class for 'git log' command
dl1998 Oct 1, 2023
fd4f29a
Add command wrappers for basic operations
dl1998 Oct 1, 2023
c8f18af
Add command wrapper for 'git log'
dl1998 Oct 1, 2023
ffd898a
Refactor GitRepository standard methods to use new command wrappers
dl1998 Oct 1, 2023
3b4401b
Remove unused import
dl1998 Oct 1, 2023
ede17ba
Update commits parser to use log command wrapper
dl1998 Oct 1, 2023
6b8ac40
Update tags parser to use for-each-ref command wrapper
dl1998 Oct 1, 2023
2c88801
Extend checkout functionality to create a new branch
dl1998 Oct 1, 2023
3302965
Extend git command to support 'commit' command
dl1998 Oct 3, 2023
6ebc8ea
Improve module reference readability
dl1998 Oct 3, 2023
df7e2e5
Update commit method used in tests
dl1998 Oct 4, 2023
c892a45
Add docstrings and typing to CheckoutHandler
dl1998 Oct 4, 2023
90dc880
Move PathsMapping to path utils
dl1998 Oct 4, 2023
de35d09
Add docstrings and typing to PathsMapping
dl1998 Oct 4, 2023
fffd323
Add docstrings and typing to GitRepository
dl1998 Oct 4, 2023
542ecd2
Add method and class for commit handling
dl1998 Oct 7, 2023
e6a376c
Cleanup and simplify models
dl1998 Oct 7, 2023
d060873
Add pytest dependency
dl1998 Oct 7, 2023
ffb7db3
Add testing utilities for options
dl1998 Oct 28, 2023
767f02d
Add tests for options base clases
dl1998 Oct 28, 2023
4c4d767
Add tests for 'git add' options
dl1998 Oct 28, 2023
4eac11c
Add tests for 'git commit' options
dl1998 Oct 28, 2023
8e79903
Add tests for 'git clone' options
dl1998 Oct 28, 2023
35e92e1
Add tests for 'git commit' options
dl1998 Oct 28, 2023
ca7ec64
Add tests for 'git config' options
dl1998 Oct 28, 2023
2e53f3a
Add tests for 'git for-each-ref' options
dl1998 Oct 28, 2023
c4add5f
Add tests for 'git init' options
dl1998 Oct 28, 2023
6cdd458
Add tests for 'git log' options
dl1998 Oct 28, 2023
da3d588
Add tests for 'git mv' options
dl1998 Oct 28, 2023
a0932e9
Add tests for 'git pull' options
dl1998 Oct 28, 2023
f98454d
Add tests for 'git push' options
dl1998 Oct 28, 2023
09d7b88
Add tests for 'git rm' options
dl1998 Oct 28, 2023
7ff1193
Add tests for 'git show' options
dl1998 Oct 28, 2023
316b850
Add tests documentation for 'git add' options
dl1998 Oct 28, 2023
abad548
Add tests documentation for 'git checkout' options
dl1998 Oct 28, 2023
a85132e
Add tests documentation for 'git clone' options
dl1998 Oct 28, 2023
216870f
Add tests documentation for 'git commit' options
dl1998 Oct 28, 2023
b20bdb4
Add tests documentation for 'git config' options
dl1998 Oct 28, 2023
3e542de
Add tests documentation for 'git for-each-ref' options
dl1998 Oct 28, 2023
afb1220
Add tests documentation for 'git init' options
dl1998 Oct 28, 2023
7f8d14a
Add tests documentation for 'git mv' options
dl1998 Oct 28, 2023
75828fb
Add tests documentation for 'git pull' options
dl1998 Oct 28, 2023
1ab87ba
Add tests documentation for 'git push' options
dl1998 Oct 28, 2023
3db7aec
Add tests documentation for 'git rm' options
dl1998 Oct 28, 2023
00bf5d2
Add tests documentation for 'git show' options
dl1998 Oct 28, 2023
47316fe
Add tests documentation for options utils class
dl1998 Oct 28, 2023
cf40b52
Add tests documentation for the tests for options module
dl1998 Dec 26, 2023
49eb2f4
Update docstring commit for validate_positional_list
dl1998 Dec 26, 2023
009be44
Add GitCommand generator and tests for validate_positional_list method
dl1998 Dec 26, 2023
b81ee63
Add test for validate_required method from GitCommand and update impl…
dl1998 Dec 27, 2023
69c63c8
Add test for validate_choices method from GitCommand and update imple…
dl1998 Dec 27, 2023
932c2b6
Add tests for CommandOptions class
dl1998 Dec 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changes in .github repository shall always be approved by an owner
.github @dl1998
setup.py @dl1998
.pylintrc @dl1998
111 changes: 111 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Perform Checks
on:
pull_request:
branches:
- main
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_NAME: 'py-git'
THRESHOLD: 0.9
permissions: write-all
jobs:
standard-checks:
name: Perform Standard Checks
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Dependencies
run: python3 -m pip install -r requirements.txt
- name: Run Pylint
uses: dciborow/[email protected]
with:
github_token: ${{ secrets.github_token }}
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
reporter: github-pr-review
# Change reporter level if you need.
# GitHub Status Check won't become failure with warning.
level: warning
glob_pattern: "sources/**/*.py"
- name: Behave Tests
run: coverage run --source="sources" -m behave tests/qualification_tests
- name: Generate XML coverage report
run: coverage xml
- name: Get Coverage
uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
thresholdAll: ${{ env.THRESHOLD }}
- name: Retrieve Total Coverage
id: coverage
if: '!cancelled()'
run: echo "TOTAL_COVERAGE=$(coverage report | grep TOTAL | awk '{ print $4 }' | sed 's/%//g')" >> "$GITHUB_ENV"
- name: Retrieve Coverage Color
if: '!cancelled()'
uses: jannekem/run-python-script-action@v1
id: coverage-color
with:
fail-on-error: false
script: |
if (int("${{ env.TOTAL_COVERAGE }}") / 100.0) < float("${{ env.THRESHOLD }}"):
print("red", end='')
else:
print("green", end='')
- name: Retrieve Release Version
id: version
if: '!cancelled()'
run: echo "VERSION=$(python3 setup.py --version)" >> "$GITHUB_ENV"
- name: Add Badges
if: '!cancelled()'
# You may pin to the exact commit or the version.
# uses: wow-actions/add-badges@43f2c1eaecfb2596b89a8136a3fbda4f18d1d188
uses: wow-actions/[email protected]
env:
repo_url: ${{ github.event.repository.html_url }}
repo_name: ${{ github.event.repository.name }}
repo_owner: ${{ github.event.repository.owner.login }}
with:
# Your GitHub token for authentication.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The badges to add with JSON format
badges: |
[
{
"badge": "https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge",
"alt": "MIT License",
"link": "${{ env.repo_url }}/blob/main/LICENSE"
},
{
"badge": "https://img.shields.io/badge/Language-Python-blue?style=for-the-badge&logo=python",
"alt": "Language",
"link": "https://www.python.org/"
},
{
"badge": "https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=for-the-badge",
"alt": "PRs Welcome",
"link": "${{ env.repo_url }}/pulls"
},
{
"badge": "https://img.shields.io/badge/TestPyPi-${{ env.VERSION }}-brightgreen.svg?style=for-the-badge",
"alt": "TestPyPi ${{ env.VERSION }}",
"link": "https://test.pypi.org/project/${{ env.REPOSITORY_NAME }}/"
},
{
"badge": "https://img.shields.io/badge/PyPi-${{ env.VERSION }}-brightgreen.svg?style=for-the-badge",
"alt": "PyPi ${{ env.VERSION }}",
"link": "https://pypi.org/project/${{ env.REPOSITORY_NAME }}/"
},
{
"badge": "https://img.shields.io/badge/Coverage-${{ env.TOTAL_COVERAGE }}%25-${{ steps.coverage-color.outputs.stdout }}.svg?style=for-the-badge",
"alt": "Coverage ${{ env.TOTAL_COVERAGE }}%"
}
]
# Path and file name to add badges
path: README.md
# Should center align the badges
center: false
33 changes: 33 additions & 0 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Documentation
on:
push:
branches: ['main', 'release']
permissions:
contents: write
jobs:
sphinx-docs:
name: Sphinx Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Update pip
run: python3 -m pip install --upgrade pip
- name: Install dependencies
run: python3 -m pip install -r requirements.txt
- name: Generate documentation for modules
run: python3 setup.py sphinx_update_modules
- name: Build Sphinx documentation
run: python3 setup.py sphinx_build
- name: Publish Documentation
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/
force_orphan: true
keep_files: true
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Release New Version
on:
push:
branches:
- main
env:
REPOSITORY_NAME: py-git
jobs:
create-release:
name: Create a new release
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Retrieve Release Version
id: version
run: echo "VERSION=$(python3 setup.py --version)" >> "$GITHUB_ENV"
- name: "✏️ Generate release changelog"
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
futureRelease: "v${{ env.VERSION }}"
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: "v${{ env.VERSION }}"
name: "Release v${{ env.VERSION }}"
bodyFile: CHANGELOG.md
- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build --sdist --wheel --outdir dist/
- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: linux-dist
path: dist/
publish-library-dev:
name: Publish new release on dev
needs: ['create-release']
permissions: write-all
runs-on: ubuntu-latest
environment:
name: dev
url: "https://test.pypi.org/project/${{ env.REPOSITORY_NAME }}/"
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: linux-dist
path: dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: "https://test.pypi.org/legacy/"
publish-library-prod:
name: Publish new release on prod
needs: ['create-release', 'publish-library-dev']
permissions: write-all
runs-on: ubuntu-latest
environment:
name: prod
url: "https://pypi.org/project/${{ env.REPOSITORY_NAME }}/"
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: linux-dist
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/build/

# PyBuilder
.pybuilder/
Expand Down Expand Up @@ -157,4 +158,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# MacOS DB file
.DS_Store
Loading