New package creation - advice/help requested

87 views
Skip to first unread message

Aram Dermenjian

unread,
Jun 29, 2023, 6:01:58 AM6/29/23
to sage-devel
Hi all,

Question for humans. I used to have a project/package for sagemath about 3 years ago that got close to getting completed, but that I never finished. (See: https://github.com/thecaligarmo/oriented_matroids) I'm now at a place to finish it, but (since it's been almost 3 years) it seems the method I was using to create a new package is no longer valid. For example, when I try and do an install, I get the following error:

     SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

I'd like for this to stay a package (at least for now) for development purposes with a potential for it to be integrated into sagemath later on. I tried to use https://doc.sagemath.org/html/en/developer/packaging.html in order to see how the new method of creating a package was, but, to be honest, I found it more confusing than enlightening as it didn't actually how how to create a new package. (It showed how to integrate an already existing package into sage, but that's about it). 

Would anyone would have the time and patience to help guide me through and/or give me the resources so I can implement something like this?

Kinndly,
Aram Dermenjian


Dima Pasechnik

unread,
Jun 29, 2023, 6:13:15 AM6/29/23
to sage-...@googlegroups.com
I've left some comments on
https://github.com/thecaligarmo/oriented_matroids/issues/2

Basically, you'd want to create a PyPI package, a standard in Python
world thing.
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/06661e5a-340c-41b8-8d98-39c874bfabb3n%40googlegroups.com.

Dima Pasechnik

unread,
Jun 29, 2023, 6:52:39 AM6/29/23
to sage-...@googlegroups.com
On Thu, Jun 29, 2023 at 11:01 AM Aram Dermenjian
<aram.derme...@gmail.com> wrote:
>
> Hi all,
>
> Question for humans. I used to have a project/package for sagemath about 3 years ago that got close to getting completed, but that I never finished. (See: https://github.com/thecaligarmo/oriented_matroids) I'm now at a place to finish it, but (since it's been almost 3 years) it seems the method I was using to create a new package is no longer valid. For example, when I try and do an install, I get the following error:
>
> SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
>
> I'd like for this to stay a package (at least for now) for development purposes with a potential for it to be integrated into sagemath later on. I tried to use https://doc.sagemath.org/html/en/developer/packaging.html in order to see how the new method of creating a package was, but, to be honest, I found it more confusing than enlightening as it didn't actually how how to create a new package. (It showed how to integrate an already existing package into sage, but that's about it).


This part of the docs addresses a different task - on integrating your
code into Sage library, not how to
create Python packages dependent on Sage (the latter is not different
from creating a Python package with external
Python dependencies)

It would be great to have a good example of this, Sage-specific - I
don't know how good https://pypi.org/project/slabbe
is good as an example.

>
> Would anyone would have the time and patience to help guide me through and/or give me the resources so I can implement something like this?
>
> Kinndly,
> Aram Dermenjian
>
>

Matthias Koeppe

unread,
Jun 29, 2023, 12:27:30 PM6/29/23
to sage-devel
On Thursday, June 29, 2023 at 3:01:58 AM UTC-7 Aram Dermenjian wrote:
it seems the method I was using to create a new package is no longer valid. For example, when I try and do an install, I get the following error:

     SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

It's not an error. If you already use "pip install" to install your package, no action is needed.
But you may want to learn about pyproject.toml (see the setuptools docs)

Travis Scrimshaw

unread,
Jul 2, 2023, 8:55:59 PM7/2/23
to sage-devel
Hi Aram,
   Can you explain a bit more why you aren't just integrating it into Sage now? Are you're expecting to have major API changes? There would likely be a push to change to using more Cython, but it doesn't need to be feature complete to be a part of Sage and internal/implementation details are easy to change.

Best,
Travis

Aram Dermenjian

unread,
Jul 5, 2023, 3:16:50 AM7/5/23
to sage-...@googlegroups.com
In essence, yes we're expecting to change much of the code as the structure will be changing in addition to fixes to some major bugs in the code. Moreover, I'm working on this with two (undergraduate) interns that I have and so they're newer to programming so I wanted them to work in a more "sandbox" environment before fully integrating it into sage.

I hadn't heard about a push to get more cython. Is this becoming more standard? 

Aram

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

Travis Scrimshaw

unread,
Jul 6, 2023, 10:02:30 PM7/6/23
to sage-devel
Not so much, but because people working in matroids usually need more speed, it tends to mean more Cython code. Compare how your implementation is done with the matroids in Sage. (For instance, you can have a category (even with Cython), but there are a number of categories that are more meant to serve a programming role, through abstraction and avoiding combinatorial explosion of classes, than a mathematical one. Matroids would be such an example.)

Best,
Travis
Reply all
Reply to author
Forward
0 new messages