Opened 5 weeks ago

Last modified 4 weeks ago

#31234 reopened defect

stem setup.py needs cleanup

Reported by: cypherpunks Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

  1. All the large strings should be in separate files.
  2. setup.py mustn't import the lib its package it is creating
  3. distutils are obsolete

Child Tickets

Change History (6)

comment:1 Changed 5 weeks ago by nickm

Component: - Select a componentCore Tor/Stem
Owner: set to atagar

comment:2 Changed 4 weeks ago by atagar

Resolution: wontfix
Status: newclosed

All the large strings should be in separate files.

I prefer this over a separate MANIFEST.in file, but happy to agree to disagree on this. :)

setup.py mustn't import the lib its package it is creating

The sole import is to gather our version, author, and other constants. The only alternative is to duplicate this information which is more error prone.

distutils are obsolete

Yup, but also sadly the only python builtin. In our case we don't need any of the capabilities setuptools provides so it is not worth taking it as a dependency.

comment:3 Changed 4 weeks ago by cypherpunks

Resolution: wontfix
Status: closedreopened

The only alternative is to duplicate this information which is more error prone.

This is wrong. Lot of projects just read the file by its path and parse the version with a regex.

Yup, but also sadly the only python builtin. In our case we don't need any of the capabilities setuptools provides so it is not worth taking it as a dependency.

You can

try:

import setuptools

except ImportError:

import distutils

comment:4 Changed 4 weeks ago by atagar

This is wrong. Lot of projects just read the file by its path and parse the version with a regex.

Actually, I used to do exactly that...

https://gitweb.torproject.org/stem.git/commit/?id=3b2a31b

What concrete benefit is there in not importing ourself?

You can... [try/except clause]

What practical reason is there to do this?

comment:5 Changed 4 weeks ago by cypherpunks

What concrete benefit is there in not importing ourself?

Building can be done from any dir.

What practical reason is there to do this?

bdist_wheel will be available

comment:6 Changed 4 weeks ago by atagar

Good points. I'll fiddle with this at some point if nobody shoots me a tested patch first.

Note: See TracTickets for help on using tickets.