troposphere icon indicating copy to clipboard operation
troposphere copied to clipboard

setup poetry

Open ITProKyle opened this issue 4 years ago • 3 comments

Summary

Setup poetry to manage project dependencies, build, and publish.

What Changed

Added

  • added configuration for poetry
    • to support the scripts arg of setuptools.setup(), will need to use a pre-release version of poetry
  • added TOML and YAML indentation settings to .editorconfig

Changed

  • troposphere.__init__.__version__ is now defined by reading the version from package metadata
  • docs/conf.py release is now defined by reading the version from package metadata
  • updated make targets to use poetry
  • updated github action workflow to use poetry
  • project metadata is now stored in pyproject.toml
  • project dependencies are now stored in pyproject.toml
  • updated contribution and release documentation for using poetry

Removed

  • remove setuptools files and metadata

ITProKyle avatar Jun 04 '21 22:06 ITProKyle

I'm not sure if the tests are actually working or ignoring failures... The output makes me think its the latter. The command I'm using to run the tests could be entirely wrong but it was my best guess and switching over from python setup.py test.

I tried to use pytest to run the tests but, some are written in a format that it does not support (tests/test_examples.py::TestExamples::test_example & tests/test_examples_template_generator.py::TestTemplateGenerator::test_template_generator) so those would need to be refactored before transitioning to pytest as the test runner.

ITProKyle avatar Jun 04 '21 23:06 ITProKyle

As nice as it would be to get poetry setup for this project, it may not be advisable in the current state of its pre-release and this project.

The issue is with adding scripts to setup.py. In order to do this, poetry 1.2 is required. I have been testing the current pre-release of 1.2 and it's not quite ready for use yet imo. yes, it works in the action but, people may run into issue when trying to use it for development or publishing releases.

If we were to convert troposphere's scripts into console_scripts, we could use the stable release of poetry 1.1.6.

ITProKyle avatar Jun 10 '21 20:06 ITProKyle

@ITProKyle Thank you for all of these changes! I'll take a deeper look at this PR and poetry after I get done getting the resources up to date. Apology for creating a Makefile conflict. Doh!

markpeek avatar Jun 13 '21 01:06 markpeek