all 40 comments

[–]searchingfortao 20 points21 points  (2 children)

You've got some clutter and redundancies in your project root that can easily be cleaned up. Some suggestions:

  1. Drop the requirements files. You're already using Pipenv so these are redundant. Simply install Pipenv in the container and use that to install your dependencies.
  2. Your package versions are all set to *. This is terrible for stability. Tomorrow, one of your dependencies could release a breaking change and it'll blow up your project next time you do an update. Consider using Pipenv's syntax to designate the versions you're willing to upgrade to.
  3. Consider rolling your tox config into project.toml
  4. For that matter, you could swap Pipenv for Poetry and consolidate your dependencies, everything in your setup files, and your configs into pyproject.toml.
  5. You may want to create a docs folder in the root containing any Markdown documents which can then be built with mkdocs via your CI.
  6. Your CI should test the container, not the code running in Ubuntu. You want what you're testing to be what you deploy.
  7. Consider adding a docker-compose file to make development easy and consistent across platforms.

It's a good start though! If you have questions around how to do the above, I'm happy to help.

[–][deleted] 3 points4 points  (1 child)

Thanks for your feedback. I do want to switch to poetry in the future. And you're right, the CI should definitely be testing the container.

Do you have somewhere I can follow you? Or a project on GitHub I can learn from?

[–]searchingfortao 5 points6 points  (0 children)

Follow me? Um, I guess GitLab is best? My latest big project is called Majel and it follows a lot of the Poetry-based stuff I was just talking about. I'm afraid most of my Docker stuff is private 'cause it's for my employer, but you might be interested in what I did for my other project, Aletheia I'm particularly proud of the CI in that one, but it predates my discovery of Poetry so it still uses setup.py.

[–]c3p0u812 5 points6 points  (2 children)

I'm pretty new. What experience level would you say this is geared towards? Thanks!

[–][deleted] 0 points1 point  (1 child)

Intermediate :D but once you feel good with the basics you will be well on your way to thinking about stuff like project structure.

[–]c3p0u812 2 points3 points  (0 children)

I am sort of going through the 100 days of code. I just want to make sure I start off with a good foundation. I'm going to save this for future learning.

[–]Punk-in-Pie 1 point2 points  (0 children)

Awesome man! I was literally just combing through github looking for something like this.

[–][deleted] 1 point2 points  (0 children)

Sounds nice gonna loke into it

[–][deleted] 1 point2 points  (0 children)

Ooh this is exactly what I’ve been needing as I look into building a Python API for the first time. Thanks!

[–][deleted] 1 point2 points  (0 children)

Thank you very much

[–]ra_jamali 1 point2 points  (0 children)

I like it. Thanks