Skip to content

Commit

Permalink
Merge pull request #59 from espin086/dev
Browse files Browse the repository at this point in the history
Added Makefile and CI/CD
  • Loading branch information
espin086 authored Sep 8, 2023
2 parents 7dd990a + d382189 commit 907f781
Show file tree
Hide file tree
Showing 270 changed files with 552 additions and 242 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/python_application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow will install Python dependencies, run tests, and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pylint black isort
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# Check Black formatting
- name: Check Black formatting
run: |
black --check .
# Lint with Pylint
- name: Lint with Pylint
run: |
pylint *.py
# Test with pytest
- name: Test with pytest
run: |
pytest
# Sort imports with isort
- name: Sort imports with isort
run: |
isort *.py
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SRC_DIR := $(shell pwd)/jobhunter/src

setup:
python3 -m venv jobhunter
. jobhunter/bin/activate && pip install -r requirements.txt
source jobhunter/bin/activate

test:
cd $(SRC_DIR) && coverage run -m pytest
cd $(SRC_DIR) && coverage report
cd $(SRC_DIR) && coverage html -d coverage_html
File renamed without changes.
Binary file removed app/.DS_Store
Binary file not shown.
43 changes: 0 additions & 43 deletions app/utilities/extract_salary.py

This file was deleted.

Empty file removed data/data_access.py
Empty file.
File renamed without changes.
8 changes: 7 additions & 1 deletion myenv/bin/Activate.ps1 → jobhunter/bin/Activate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ function global:deactivate ([switch]$NonDestructive) {
Remove-Item -Path env:VIRTUAL_ENV
}

# Just remove VIRTUAL_ENV_PROMPT altogether.
if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
Remove-Item -Path env:VIRTUAL_ENV_PROMPT
}

# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
Expand Down Expand Up @@ -197,7 +202,7 @@ else {
$Prompt = $pyvenvCfg['prompt'];
}
else {
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)"
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
$Prompt = Split-Path -Path $venvDir -Leaf
}
Expand Down Expand Up @@ -228,6 +233,7 @@ if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
_OLD_VIRTUAL_PROMPT
}
$env:VIRTUAL_ENV_PROMPT = $Prompt
}

# Clear PYTHONHOME
Expand Down
7 changes: 5 additions & 2 deletions myenv/bin/activate → jobhunter/bin/activate
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ deactivate () {
fi

unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
Expand All @@ -37,7 +38,7 @@ deactivate () {
# unset irrelevant variables
deactivate nondestructive

VIRTUAL_ENV="/Users/jjespinoza/Documents/jobhunter/myenv"
VIRTUAL_ENV="/Users/jjespinoza/Documents/jobhunter/jobhunter"
export VIRTUAL_ENV

_OLD_VIRTUAL_PATH="$PATH"
Expand All @@ -54,8 +55,10 @@ fi

if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(myenv) ${PS1:-}"
PS1="(jobhunter) ${PS1:-}"
export PS1
VIRTUAL_ENV_PROMPT="(jobhunter) "
export VIRTUAL_ENV_PROMPT
fi

# This should detect bash and zsh, which have a hash command that must
Expand Down
7 changes: 4 additions & 3 deletions myenv/bin/activate.csh → jobhunter/bin/activate.csh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# Created by Davide Di Blasi <[email protected]>.
# Ported to Python 3.3 venv by Andrew Svetlov <[email protected]>

alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'

# Unset irrelevant variables.
deactivate nondestructive

setenv VIRTUAL_ENV "/Users/jjespinoza/Documents/jobhunter/myenv"
setenv VIRTUAL_ENV "/Users/jjespinoza/Documents/jobhunter/jobhunter"

set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
Expand All @@ -17,7 +17,8 @@ setenv PATH "$VIRTUAL_ENV/bin:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"

if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
set prompt = "(myenv) $prompt"
set prompt = "(jobhunter) $prompt"
setenv VIRTUAL_ENV_PROMPT "(jobhunter) "
endif

alias pydoc python -m pydoc
Expand Down
15 changes: 10 additions & 5 deletions myenv/bin/activate.fish → jobhunter/bin/activate.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ function deactivate -d "Exit virtual environment and return to normal shell env
end

if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
functions -e fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
# prevents error when using nested fish instances (Issue #93858)
if functions -q _old_fish_prompt
functions -e fish_prompt
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
end
end

set -e VIRTUAL_ENV
set -e VIRTUAL_ENV_PROMPT
if test "$argv[1]" != "nondestructive"
# Self-destruct!
functions -e deactivate
Expand All @@ -29,7 +33,7 @@ end
# Unset irrelevant variables.
deactivate nondestructive

set -gx VIRTUAL_ENV "/Users/jjespinoza/Documents/jobhunter/myenv"
set -gx VIRTUAL_ENV "/Users/jjespinoza/Documents/jobhunter/jobhunter"

set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
Expand All @@ -52,7 +56,7 @@ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
set -l old_status $status

# Output the venv prompt; color taken from the blue of the Python logo.
printf "%s%s%s" (set_color 4B8BBE) "(myenv) " (set_color normal)
printf "%s%s%s" (set_color 4B8BBE) "(jobhunter) " (set_color normal)

# Restore the return status of the previous command.
echo "exit $old_status" | .
Expand All @@ -61,4 +65,5 @@ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
end

set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
set -gx VIRTUAL_ENV_PROMPT "(jobhunter) "
end
4 changes: 2 additions & 2 deletions myenv/bin/pip3.9 → jobhunter/bin/coverage
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
from coverage.cmdline import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
8 changes: 8 additions & 0 deletions jobhunter/bin/coverage-3.11
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
from coverage.cmdline import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
8 changes: 8 additions & 0 deletions jobhunter/bin/coverage3
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
from coverage.cmdline import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
2 changes: 1 addition & 1 deletion myenv/bin/dotenv → jobhunter/bin/dotenv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/f2py → jobhunter/bin/f2py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/f2py3 → jobhunter/bin/f2py3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/f2py3.9 → jobhunter/bin/f2py3.11
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/jsonschema → jobhunter/bin/jsonschema
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/markdown-it → jobhunter/bin/markdown-it
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/nltk → jobhunter/bin/nltk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/normalizer → jobhunter/bin/normalizer
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/pip → jobhunter/bin/pip
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/pip3 → jobhunter/bin/pip3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/pip3.11 → jobhunter/bin/pip3.11
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/py.test → jobhunter/bin/py.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/pygmentize → jobhunter/bin/pygmentize
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion myenv/bin/pytest → jobhunter/bin/pytest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
1 change: 1 addition & 0 deletions jobhunter/bin/python
1 change: 1 addition & 0 deletions jobhunter/bin/python3
1 change: 1 addition & 0 deletions jobhunter/bin/python3.11
2 changes: 1 addition & 1 deletion myenv/bin/streamlit → jobhunter/bin/streamlit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion myenv/bin/tqdm → jobhunter/bin/tqdm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/Users/jjespinoza/Documents/jobhunter/myenv/bin/python3
#!/Users/jjespinoza/Documents/jobhunter/jobhunter/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
Empty file.
5 changes: 5 additions & 0 deletions jobhunter/pyvenv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
home = /opt/homebrew/opt/[email protected]/bin
include-system-site-packages = false
version = 3.11.5
executable = /opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/bin/python3.11
command = /opt/homebrew/opt/[email protected]/bin/python3.11 -m venv /Users/jjespinoza/Documents/jobhunter/jobhunter
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import logging
import pprint


from app import config
import config

# Initialize pretty printer and logging
pp = pprint.PrettyPrinter(indent=4)
Expand Down
Loading

0 comments on commit 907f781

Please sign in to comment.