akx / pyproject-migrator

Convert setup.cfg, etc. to pyproject.toml files
MIT License
13 stars 3 forks source link

I can't seem to convert even a simple setup.cfg file ? #8

Open ChrisBarker-NOAA opened 3 weeks ago

ChrisBarker-NOAA commented 3 weeks ago

I have a pretty simple setup.confg file -- only the core project functionality:

It is a setuptools project (which I think is always the case for setup.cfg, but I get this result when I try to run it:

WARNING: setup.cfg: setuptools sections ['metadata', 'options', 'options.entry_points', 'options.package_data']; porting depends on which toolset to use. For example, hatch (https://pypi.org/project/hatch/) can port metadata to pyproject.toml.

I'm confused -- this seems like the very basic, normal stuff -- can't I even get the toml for metadata?

What am I missing?

-Thanks

akx commented 3 weeks ago

pyproject-migrator doesn't want to prescribe which toolset to use for packaging; it migrates other things.

If you want to migrate to e.g. Hatch, the "migrating existing documentation" documentation for Hatch says to use hatch new --init. Other packaging toolsets may have migration tools of their own.

You can also even keep using setup.cfg and use setuptools's build backend.

ChrisBarker-NOAA commented 3 weeks ago

Fair enough -- you may want to make that a bit more clear in the docs.

However, IIUC, some sections are not build-system specific.

metadata for sure, and I think scripts as well.

My goal was to convert a setuptools setup.cfg based setup to a setuptools pyproject.yaml setup. Granted, setuptools should provide this (and oddly doesn't seem to), so what I did was use hatch to convert to a hatch setup, and then swap out the hatch-sepcific parts.

and that worked great for the metadata and scripts sections :-)

So you could provide something quite useful here, if you want to.