Git Product home page Git Product logo

Comments (10)

shenxianpeng avatar shenxianpeng commented on June 15, 2024 1

I have used setuptools_scm in clang-tools-pip, and released the package to PyPI automatically. No longer need to manually update the version in setup.py.

from cpp-linter-action.

shenxianpeng avatar shenxianpeng commented on June 15, 2024 1

Very cool! So I used a local_scheme called no-local-version

https://github.com/cpp-linter/clang-tools-pip/blob/a63ca48822d0e3092686f26ec40162f75e936b9b/setup.py#L17

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 15, 2024 1

Yep, that's part of the solution. The rest of it is more like
https://github.com/jbms/sphinx-immaterial/blob/bf169751fba59362bcd06da96bfa65b2728cbbae/setup.py#L193-L200

from cpp-linter-action.

shenxianpeng avatar shenxianpeng commented on June 15, 2024 1

In this setup.py, you named the package as "cpp_linter", maybe we called "cpp-linter" better than "cpp-linter-action".
If we called "cpp-linter-action" on pypi, it looks like it's a GitHub action.

For example clang-tools-pip project, the package on pypi we called "clang-tools", not "clang-tools-pip".

from cpp-linter-action.

shenxianpeng avatar shenxianpeng commented on June 15, 2024

So I guess after this changes when we draft or create a new release, there is a release workflow can automatically update version from setup.py, commit the changes, build and upload the package to pypi then tag the latest commit to v1.
Please correct me if I am wrong.

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 15, 2024

We (or rather you) will still manage the tags. The setuptools_scm module will only get the latest tag (via git) and use that as the version number whenever we make a distribution, like so:

python setup.py bdist_wheel

The same happens when we install the pkg from source

python -m pip install .

If we build or install on a non-tagged commit, then the latest tag will be appended with info to show the difference between releases. For example: If the latest tag is v2.0.0, and there have been 3 commits since that tagged commit, then the version number used will be v2.0.0.post1.dev3 (translates to 1st "post-release" at 3rd commit since v2.0.0). However, pypi sees v2.0.0.post1.dev3 as a "pre-release", so pip would still install the latest "stable" release (pre-release versions need to be specified explicitly).

from cpp-linter-action.

shenxianpeng avatar shenxianpeng commented on June 15, 2024

That sounds great 👍

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 15, 2024

Pretty cool isn't it?

I can make some modifications so that we can publish pre-releases to test-pypi... Pypi (& test-pypi) don't like it when the version name/number uses part of the commit sha. By default, setuptools_scm uses the commit sha in the version if the commit is not a tagged commit.

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 15, 2024

I've got this working the same as it is in clang-tools-pip project.

@shenxianpeng should we be publishing to pypi using the name "cpp-linter-action"? I currently have it set to "cpp-linter", but I'm afraid that might be confused with cpplint.

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 15, 2024

name = "cpp_linter"

I didn't notice the _ here. You're correct, it should be -.

from cpp-linter-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.