Nettacker icon indicating copy to clipboard operation
Nettacker copied to clipboard

Implement package publishing PoC

Open arkid15r opened this issue 1 year ago • 0 comments

Checklist

  • [ ] I have followed the Contributor Guidelines.
  • [ ] The code has been thoroughly tested in my local development environment with flake8 and pylint.
  • [x] The code is Python 3 compatible.
  • [x] The code follows the PEP8 styling guidelines with 4 spaces indentation.
  • [ ] This Pull Request relates to only one issue or only one feature
  • [x] I have referenced the corresponding issue number in my commit message
  • [ ] I have added the relevant documentation.
  • [x] My branch is up-to-date with the Upstream master branch.

Changes proposed in this pull request

I started my work on this PR to address #633. The next step implementation was getting the Nettacker its own PyPI package. So far trusted publish management has been configured for my personal account for both PyPI and Test PyPI platforms. So now the package can be installed using pip install nettacker command (the current version is 0.3.1alpha). The docker image build process has been adjusted to use the published package.

As a part of poetry setup I moved source code to src/nettacker directory (this is why 750 files are shown as changed). The number of actually changed files is way smaller and they mostly include the following changes:

  • file and import paths adjustments according to the new src/nettacker project structure
  • .github CI/CD configuration (tests and publishing)
  • Dockerfile refactoring to use PyPI package
  • dependencies are now a part of pyproject.toml

I added pytest support and fixed existing tests:

  • as a part of PoC I added top_1000_common_passwords test to check the password for uniqueness
  • the dictionary sort test didn't make sense and has been rewritten (it used unittest::assertDictEqual method which doesn't check for dict keys order)
  • the select_maximum_cpu_core test has been changed to use a mock (it was failing on the GH when I ran it first), and the method itself has been refactored a bit

The next steps:

  • test the publishing workflow using jobs with sufficient permissions (it went smoothly end to end using my personal GH repository and Docker registry)
  • figure out the preferred way of work with docker in dev environment
  • update wiki documentation
  • add project leaders as owners to PyPI platforms
  • address any suggestions/comments from project leaders and PR reviewers

arkid15r avatar Oct 29 '23 01:10 arkid15r