question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Setup function copies the entire directory into the dist

See original GitHub issue

setuptools version

setuptools == 61.3.1

Python version

Python 3.8.10

OS

Windows 10

Additional environment information

No response

Description

This setup.py file

# -*- coding: utf-8 -*-
from setuptools import setup, find_packages

with open('README.rst', 'r', encoding='utf-8') as file:
    readme = file.read()

setup(
  name = 'PDIpy',      
  package_dir = {'pdi':'pdipy'},
  packages = find_packages(),
  package_data = {
          'pdipy': ['parameters/*'],
          'test': ['*']
          }, 
  version = '0.0.5',
  license = 'MIT',
  description = "Simulate Photodynamic Inactivation (PDI) from a kinetics model of membrane oxidation.", 
  long_description = readme,
  author = 'Andrew Freiburger',               
  author_email = 'andrewfreiburger@gmail.com',
  url = 'https://github.com/freiburgermsu/PDIpy',   
  keywords = [
          'antibacterial',
          'photodynamic', 
          'biophysics',
          'computational',
          'biology',
          'medicine', 
          'PDI', 
          'antibiotics'
          ],
  install_requires = [
          'matplotlib',
          'tellurium', 
          'scipy', 
          'pandas',
          'sigfig',
          'hillfit',
          'chemw',
          'numpy'
          ]
)

copies this entire directory into the dist folder, perplexingly including the examples folder that is neither mentioned in the setup.py file nor contains any script that could be perceived to be a package by find_packages(). This error is strangely also occurring with old setup.py files that previously worked perfectly. Changing or removing most of the arguments and values has been ineffectual.

What in the setup file is erroneous, and how can it be resolved?

Expected behavior

A dist folder should be created that exclusively contains content from the test and pdipy folders, which are specified in the setup.py file.

How to Reproduce

python setup.py sdist in Powershell.

Output

PS C:\Users\Andrew Freiburger\Dropbox\My PC (DESKTOP-M302P50)\Documents\UVic Civil Engineering\PDIpy\PDIpy> python .\setup.py sdist
running sdist
running egg_info
writing PDIpy.egg-info\PKG-INFO
writing dependency_links to PDIpy.egg-info\dependency_links.txt
writing requirements to PDIpy.egg-info\requires.txt
writing top-level names to PDIpy.egg-info\top_level.txt
writing manifest file 'PDIpy.egg-info\SOURCES.txt'
running check
creating PDIpy-0.0.5
creating PDIpy-0.0.5\.github
creating PDIpy-0.0.5\.github\workflows
creating PDIpy-0.0.5\PDIpy.egg-info
creating PDIpy-0.0.5\docs
creating PDIpy-0.0.5\docs\source
creating PDIpy-0.0.5\examples
creating PDIpy-0.0.5\examples\Beirao_et_al
creating PDIpy-0.0.5\examples\Beirao_et_al\Beirao_et_al, 10 uM solution
creating PDIpy-0.0.5\examples\Beirao_et_al\Beirao_et_al, 20 uM solution
creating PDIpy-0.0.5\examples\Beirao_et_al\Beirao_et_al, 5 uM solution
creating PDIpy-0.0.5\examples\Beirao_et_al\Beirao_et_al, biofilm, 10 uM solution
creating PDIpy-0.0.5\examples\Beirao_et_al\Beirao_et_al, biofilm, 20 uM solution
creating PDIpy-0.0.5\examples\Beirao_et_al\Beirao_et_al, biofilm, 5 uM solution
creating PDIpy-0.0.5\examples\Bozja_et_al
creating PDIpy-0.0.5\examples\GSWL
creating PDIpy-0.0.5\examples\GSWL\.ipynb_checkpoints

... The console lines were too great for GitHub to post in this issue ...

copying supplementary\.ipynb_checkpoints\photosensitizer_volume_proportion-checkpoint.ipynb -> PDIpy-0.0.5\supplementary\.ipynb_checkpoints
copying test\__init__.py -> PDIpy-0.0.5\test
copying test\test_pdi.py -> PDIpy-0.0.5\test
Writing PDIpy-0.0.5\setup.cfg
Creating tar archive
removing 'PDIpy-0.0.5' (and everything under it)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
abravalhericommented, Apr 12, 2022

pip’s isolation less powerful than build’s. For example, in this case it seems that the existence of build caches might influence the end result.

I understand that automatic invalidation of cache is a “nice to have” feature. If you would like to give a try and propose a PR, I would be more than happy to review it.

☝️ meanwhile users can try rm -rf build dist *.egg-info (or src/*.egg-info) during the troubleshooting.

1reaction
drewcassidycommented, Apr 8, 2022

Clearing the build directory fixed the issue. that makes sense, I was messing with package discovery and I guess it cached it with a bunch of files I didn’t want

I think there is still a bug here, since the cache should be cleared/updated instead of keeping old files around that shouldn’t be there. Is the build directory handled by setuptools or something else?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does `python setup.py sdist` copy the entire directory into ...
I have a similar issues. Tried using the following steps: Remove dist and *.egg-info folders. Instead of using python setup.py sdist ...
Read more >
Typescript compiler --copy-files option to copy non ... - GitHub
It detects the source and output directories based on your project's tsconfig. json (using typescript's own config parser, to work as smooth as ......
Read more >
Why won't my cp command copy whole directories? [duplicate]
It specifies recursive copy i.e. all sub-directories and files will be copied. Use man cp to find more switches for cp. Share.
Read more >
The Ultimate Guide to Copying Files and Folders Using Xcopy
In this guide, you will learn how to use Xcopy for various file copy scenarios. From copying a single file, multiple directories, applying ......
Read more >
CopyWebpackPlugin | webpack
Copies individual files or entire directories, which already exist, to the build directory. Getting Started. To begin, you'll need to install copy-webpack- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found