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

Wrap the project in a Python package with a CLI command #9

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

weaversam8
Copy link

This makes Stacks installable with pip! Now you won't have to copy the source files into your Terraform repository, and instead of having to remember the correct number of ../../../ to use, you can just run stacks preinit and stacks postinit.

The preinit.py and postinit.py files still support being run manually, for backwards compatibility. Currently the package isn't listed on PyPi, but that can be added in the future if desired. For now, you can install manually from GitHub, using the instructions in README.md.

NOTE: The diff displayed in the PR makes it look like I deleted/rewrote preinit.py and postinit.py. For a better diff, see the changes between these two commits. I just added a bit of code to enable these files to work both as scripts and as dependencies to cli.py.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

This is to prepare to package this repo as an installable Python package
@weaversam8 weaversam8 requested a review from a team as a code owner September 19, 2024 16:17
@weaversam8
Copy link
Author

In my most recent commit, I also added an automated test to make sure the older pattern of invoking this module never breaks. Reasoning being: if I add any new features in future PRs, I'd want to make sure the existing pattern can continue to be used so we can maintain backwards compatibility.

@ribejara-te ribejara-te self-assigned this Sep 20, 2024
@ribejara-te
Copy link
Contributor

Hey @weaversam8, after thorough discussion with the team we're soon going to write a v2 version of Stacks that among other things, will transform it into a CLI.

We'll be doing that over next quarter (starting Nov) and it includes a fair deal of changes. We're also aiming at using the upstream (this) version of Stacks instead of our own private fork of it, so that you and everybody else get the same updates as we do.

We'll keep this open because the work you did here may inspire ours.

Thanks,
RB

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