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

Use Hatchling build-backend and fix README for PyPI #1051

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

maresb
Copy link
Contributor

@maresb maresb commented Sep 19, 2024

Description

See individual commits for a breakdown.

  • Switch from setuptools to hatchling because setuptools is really crusty. (Note that Hatchling is just a build backend so it doesn't necessitate the use of Hatch or any other build front-end; you can keep using pip and python -m build as normal.)
  • Clean up a bunch of the README links
  • Set up some regex to automatically convert links

The result of the regex can be previewed with pipx run hatch-fancy-pypi-readme and the diff is

3c3
< ![PyMC-Marketing Logo](docs/source/_static/marketing-logo-light.jpg)
---
> ![PyMC-Marketing Logo](https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/docs/source/_static/marketing-logo-light.jpg)
30c30
<     <img src="docs/source/_static/labs-logo-light.png" width="50%" />
---
>     <img src="https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/docs/source/_static/labs-logo-light.png" width="50%" />
33c33
< For businesses looking to integrate PyMC-Marketing into their operational framework, [PyMC Labs](https://www.pymc-labs.com) offers expert consulting and training. Our team is proficient in state-of-the-art Bayesian modeling techniques, with a focus on Marketing Mix Models (MMMs) and Customer Lifetime Value (CLV). For more information see [here](README.md#-schedule-a-free-consultation-for-mmm--clv-strategy).
---
> For businesses looking to integrate PyMC-Marketing into their operational framework, [PyMC Labs](https://www.pymc-labs.com) offers expert consulting and training. Our team is proficient in state-of-the-art Bayesian modeling techniques, with a focus on Marketing Mix Models (MMMs) and Customer Lifetime Value (CLV). For more information see [here](https://github.com/pymc-labs/pymc-marketing/tree/main/README.md#-schedule-a-free-consultation-for-mmm--clv-strategy).
57c57
< We provide a `Dockerfile` to build a Docker image for PyMC-Marketing so that is accessible from a Jupyter Notebook. See [here](scripts/docker/README.md) for more details.
---
> We provide a `Dockerfile` to build a Docker image for PyMC-Marketing so that is accessible from a Jupyter Notebook. See [here](https://github.com/pymc-labs/pymc-marketing/tree/main/scripts/docker/README.md) for more details.
114c114
< ![](docs/source/_static/mmm_plot_components_contributions.png)
---
> ![](https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/docs/source/_static/mmm_plot_components_contributions.png)
119c119
<     <img src="docs/source/_static/mmm_plot_plot_channel_contributions_grid.png" width="80%" />
---
>     <img src="https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/docs/source/_static/mmm_plot_plot_channel_contributions_grid.png" width="80%" />
169c169
< ![](docs/source/_static/expected_purchases.png)
---
> ![](https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/docs/source/_static/expected_purchases.png)
175c175
< PyMC-Marketing is and will always be free for commercial use, licensed under [Apache 2.0](LICENSE). Developed by core developers behind the popular PyMC package and marketing experts, it provides state-of-the-art measurements and analytics for marketing teams.
---
> PyMC-Marketing is and will always be free for commercial use, licensed under [Apache 2.0](https://github.com/pymc-labs/pymc-marketing/tree/main/LICENSE). Developed by core developers behind the popular PyMC package and marketing experts, it provides state-of-the-art measurements and analytics for marketing teams.
199a200
> 

Related Issue

Checklist

Modules affected

  • MMM
  • CLV

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pymc-marketing--1051.org.readthedocs.build/en/1051/

@maresb maresb requested a review from wd60622 September 19, 2024 08:58
@wd60622
Copy link
Contributor

wd60622 commented Sep 19, 2024

Not very familiar but logically makes sense

pyproject.toml Outdated Show resolved Hide resolved
@wd60622
Copy link
Contributor

wd60622 commented Sep 19, 2024

Does pipx run hatch-fancy-pypi-readme have to be manually run again?

@maresb
Copy link
Contributor Author

maresb commented Sep 19, 2024

Nope, the only thing that command does is to print a preview of the modified README to stdout.

That command is useful for checking if the PyPI version of the README will come out as expected.

@juanitorduz
Copy link
Collaborator

Thanks @maresb ! Out of curiosity ... is this part of a plan to move to pixi or in your opinion is not necessary (I genuinely do not know)

@maresb
Copy link
Contributor Author

maresb commented Sep 19, 2024

It's independent. The pixi stuff should not and will not touch pyproject.toml. The environment management (pixi config) is independent from the package definition (pyproject.toml) except for the environment including the package.

Pixi does allow its config to be read from pyproject.toml by prepending tool.pixi. to all the table names, but I'm very opinionated that this is an awful idea due to the potential for confusion.

@maresb
Copy link
Contributor Author

maresb commented Sep 19, 2024

Ah I meant to link this. Here's what adding pixi looks like: pymc-labs/CausalPy#412

@juanitorduz
Copy link
Collaborator

I think this PR is failing because an unrelated issue (mmm.save("model.nc") in the example notebook). I had commented that line before so I'll patch this again tonight)

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.60%. Comparing base (d0070ca) to head (8ed42e0).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1051      +/-   ##
==========================================
- Coverage   95.86%   95.60%   -0.27%     
==========================================
  Files          39       39              
  Lines        3940     3934       -6     
==========================================
- Hits         3777     3761      -16     
- Misses        163      173      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maresb
Copy link
Contributor Author

maresb commented Sep 20, 2024

Thanks @juanitorduz and @wd60622! All green now.

@juanitorduz juanitorduz merged commit f70db33 into pymc-labs:main Sep 20, 2024
12 checks passed
@juanitorduz
Copy link
Collaborator

Amazing! Thanks @maresb !

@maresb maresb deleted the hatchling-and-fix-readme branch September 20, 2024 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken images on PyPI Automatic module discovery in pyproject.toml
3 participants