Skip to content

Pyproject#27

Open
tvandera wants to merge 9 commits intobegleysm:masterfrom
tvandera:pyproject
Open

Pyproject#27
tvandera wants to merge 9 commits intobegleysm:masterfrom
tvandera:pyproject

Conversation

@tvandera
Copy link

@tvandera tvandera commented Feb 17, 2025

First PR in a set of cleanups. This one adds

  • pyproject.toml package with hatch. You can now do pip install .
  • fix typo: (old_exernal_ip)
  • config.txt: add dry_run=1 option for testing in CI
  • CI using Github Workflows: pip install + test
  • update documentation

@tvandera tvandera force-pushed the pyproject branch 2 times, most recently from 75af161 to db404cd Compare February 17, 2025 10:46
@tvandera tvandera marked this pull request as ready for review February 17, 2025 12:49
@tvandera
Copy link
Author

Results from CI available here: https://github.com/tvandera/ipwatch/actions/workflows/tests.yml

@tvandera
Copy link
Author

@begleysm This PR is ready. Please test on your side.

@begleysm
Copy link
Owner

Hi Tim. Thanks for submitting the PR. Sorry about the delay.

I saw the PR & started testing. Found that the README needs some updates & then got busy with work.

I'll have his reviewed by the end of the weekend.

@begleysm
Copy link
Owner

So I'm having trouble following the README to get everything installed and running with the new python virtual environment.

I admit to not being all that familiar with python virtual environments.

Firstly I had to install python3-env so that should be noted in the README.

I went on to create the venv and then, I think I should be cding into /opt (so that the clone puts the diectory at /opt/ipwatch) though that isn't listed in the README. Note that I did clone https://github.com/tvandera/ipwatch/ and then checkout pyproject.

I tried running . /opt/ipwatch/bin/activate from /opt and was met with -bash: /opt/ipwatch/bin/activate: No such file or directory.

I also tried running the install stuff from ~ but didn't have any more luck.

Can you provide some more guidance?

@tvandera
Copy link
Author

tvandera commented Feb 24, 2025

Thanks for testing. Let me try to show you what works for me.

In a clean Ubuntu 22.04, I indeed need to install python3 and python3-venv:

apt install python3-venv

Next create a python virtualenv in /opt/ipwatch

python3 -m venv /opt/ipwatch 

Activate the venv:

source /opt/ipwatch/bin/activate

With the virtual env activated,

  • clone the ipwatch repo, for example in a temporary directory.
  • pip install the package cloned repo
cd /tmp
git clone https://github.com/tvandera/ipwatch
pip install ipwatch

Test it using the provided test_config:

ipwatch ipwatch/test_config.txt  

Full log in attach

ipwatch_ubuntu2204_docker.txt

@begleysm
Copy link
Owner

begleysm commented Mar 5, 2025

I promise I haven't forget about this. I've just been swamped with real life + a back injury.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants