jrxFive / python-nomad

Client library Hashicorp Nomad
https://python-nomad.readthedocs.io/en/latest/
MIT License
139 stars 73 forks source link

Add namespace agrs for deployment and allocations endpoints #133

Closed nikita-b closed 1 year ago

nikita-b commented 1 year ago
  1. Added support for namespace arguments for deployment and allocations endpoints.
  2. Added support for Python 3.10.
  3. Upgrade requests library (support 3.10 Python). This version also doesn't support Python 3.5. The latest version of lib doesn't support even 2.7/3.6 and I'm not sure about your plans for support these versions.
jonathanrcross commented 1 year ago

Hi @nikita-b, thanks so much for the PR! I brought down this branch locally and to run tests and saw similar failed test cases. If you want to run tests locally you can do the following:

#run nomad as server and agent, you will need to kill/restart after running the test suite
./nomad agent -dev -node pynomad1 --acl-enabled
# only need to run this once
nomad run -output example.nomad > example.json

NOMAD_IP=127.0.0.1 NOMAD_VERSION=1.3.5 py.test --cov=nomad --cov-report=term-missing --runxfail tests/

test-results.txt

nikita-b commented 1 year ago

@jonathanrcross Yep, my bad. I fixed. Could you recheck pls?

codecov-commenter commented 1 year ago

Codecov Report

Merging #133 (1796a61) into master (1cc1077) will increase coverage by 0.00%. The diff coverage is 93.06%.

@@           Coverage Diff           @@
##           master     #133   +/-   ##
=======================================
  Coverage   90.61%   90.61%           
=======================================
  Files          26       27    +1     
  Lines        1065     1129   +64     
=======================================
+ Hits          965     1023   +58     
- Misses        100      106    +6     
Impacted Files Coverage Δ
nomad/api/base.py 96.55% <80.00%> (-1.04%) :arrow_down:
nomad/api/event.py 86.66% <86.66%> (ø)
nomad/__init__.py 98.29% <100.00%> (+0.06%) :arrow_up:
nomad/api/__init__.py 100.00% <100.00%> (ø)
nomad/api/allocations.py 100.00% <100.00%> (ø)
nomad/api/deployments.py 90.24% <100.00%> (+0.50%) :arrow_up:
nomad/api/exceptions.py 100.00% <100.00%> (ø)
nomad/api/job.py 94.59% <100.00%> (+0.22%) :arrow_up:
nomad/api/jobs.py 90.00% <100.00%> (+0.41%) :arrow_up:
nomad/api/agent.py 92.85% <0.00%> (-7.15%) :arrow_down:
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

nikita-b commented 1 year ago

@jonathanrcross @jrxFive Could you review/merge, pls?