0

I have some one ADO pipeline which builds and destributes my python client app. During the pipline two builds are created, one for STAGE and one for PROD. According this I need to build my-project-stage as a STAGE artifact and my-project as a PROD artifact. They are both from the same commit. My question is how can I set and read variables inside the setup.cfg for the project name and for config file name (include stage app's config for NONPROD and prod app's config for the PROD build).

Something like this inside setup.cfg: enter image description here

Is it possible? Or there is another way to do it?

Note: I don't use the setup.py in my project, but pyproject.toml (due to PEP-517 and PEP-518 compatibility)

FreeGor
  • 615
  • 13
  • 26
  • Basically, a convoluted duplicate to this. https://stackoverflow.com/questions/19379120/how-to-read-a-config-file-using-python – Roey Michaeli Jul 11 '22 at 13:16
  • 1
    @RoeyMichaeli Totally not. Your link is about the reading config/text files, but my question about dynamic customization the build process config – FreeGor Jul 11 '22 at 13:38
  • Which is basically, reading and writing a cfg. Read a cfg, get the variables, and change constants based on that. If I misunderstood, please elaborate. – Roey Michaeli Jul 11 '22 at 13:44
  • @RoeyMichaeli not my code reads the setup.cfg, but the setuptools, so I can't controll this reading process and manipulate it. What I can to do it's just call *python -m build* and it automattically should build the project by setup.cfg configurations. – FreeGor Jul 11 '22 at 13:58

0 Answers0