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

Improve Action to Build and PyPi Release #843

Merged
merged 34 commits into from
Feb 18, 2025

Conversation

xRowe
Copy link
Contributor

@xRowe xRowe commented Feb 17, 2025

  1. Update tox.ini pytest version to make test on python3.13 success
  2. Update ci.yml to enable test on MacOS and python3.13
  3. Substitute setup.cfg & setup.py with pyproject.toml, and remove tests folder in the build
  4. remove some _version files. etc.
  5. Update -> package version would be defined in file canmatrix.init attritbue version="x.y.z", Update everytime if RELEASE is wanted
  6. Update ci.yml to enable when create Release in Github, it will automatically release to PyPI.
  7. Update the README.md and convert it into README.rst, which would also presentation on PyPI

Demo on PyPI:
https://pypi.org/project/testpypi-canmatrix/

In my opinion, the tests file/scripts, should not occur in the release, so I remove it.
But the j1939.dbc, I have no idea to remove it, as it is necessary in j1939_decoder.py

Could you have a look if anything need improve?

Thanks,
Rowe

@coveralls
Copy link

coveralls commented Feb 17, 2025

Pull Request Test Coverage Report for Build 13388782039

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.8%) to 54.518%

Totals Coverage Status
Change from base Build 13368031435: 1.8%
Covered Lines: 4453
Relevant Lines: 8168

💛 - Coveralls

@ebroecker
Copy link
Owner

Hi @xRowe

first of all thanks a for investigation your time in the CI issues!
This is definitely a thing which needs some work in canmatrix.

I don't understand everything perfectly, maybe you could help me a bit:

  1. Update... : Does the release only happen if merged to master or does it also create a release and publish it, if canmatrix.__init__ is updated in other branch?
    Some times ago, when the "old CI" was working, a release was just created and uploaded every time I created a tag in master branch.
    What is the new workflow for doing a release? Change canmatrix.__init__ in master-branch and create a tag afterwards? How should this be done the correct way? Sorry, this question might seem stupid, but I have nearly no experience with the github ci...

  2. Where have I to change, that it will publish in the correct PyPI, or does it work somehow magic if I enable github in PyPI?

And yes, j1939_decoder.py needs the dbc, while I don't know if anybody uses the j1939 decoder.

@xRowe
Copy link
Contributor Author

xRowe commented Feb 17, 2025

5.Update... : Does the release only happen if merged to master or does it also create a release and publish it, if canmatrix.init is updated in other branch?
Some times ago, when the "old CI" was working, a release was just created and uploaded every time I created a tag in master branch.
What is the new workflow for doing a release? Change canmatrix.init in master-branch and create a tag afterwards? How should this be done the correct way? Sorry, this question might seem stupid, but I have nearly no experience with the github ci...
->
new workflow for doing a release I think you can do is,

  1. Where have I to change, that it will publish in the correct PyPI, or does it work somehow magic if I enable github in PyPI?
    ->
    Firstly, of course need your account in PyPI which organize canmatrix
    Then, need to Add a new pending publisher in https://pypi.org/manage/account/publishing/
    PyPI Project Name: canmatrix
    Owner: ebroecker
    Repository name: https://github.com/ebroecker/canmatrix
    Workflow name: ci.yml
    Click "Add", and think is ready.

After that, if release is triggered in the future, and builds is/are successful, then it will automatically upload to PyPI, and the version is equal to the one is set in file src/canmatrix/__init__.py attribute version

@ebroecker
Copy link
Owner

Hi @xRowe

thanks again, sounds good to me, I think understand now, gonna try this for the next release.
I'll merge this pr now.

@ebroecker ebroecker merged commit dfe0018 into ebroecker:development Feb 18, 2025
21 of 22 checks passed
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.

3 participants