Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't filter git metafiles out when building #2774

Closed
bilderbuchi opened this issue Mar 22, 2018 · 3 comments · Fixed by #2777
Closed

Don't filter git metafiles out when building #2774

bilderbuchi opened this issue Mar 22, 2018 · 3 comments · Fixed by #2777
Labels
locked [bot] locked due to inactivity

Comments

@bilderbuchi
Copy link
Contributor

I am including a cookiecutter template for creating well-formed python projects with an (internal) utility package. This template includes all I need for good version control, i.e. a pre-filled .gitignore and .gitattributes file.
Building the package with python setup.py sdist works nicely.
Building the package with python setup.py bdist works as well, except for an unrelated issue with compiled template files, which I since circumvented.

Actual Behavior

Building the package with python setup.py bdist_conda nearly works, but my shipped template is missing the .gitignore, but not the .gitattributes files!

Expected Behavior

Building the package with python setup.py bdist_conda works, and my package contains all the files I want it to.

I am pretty sure I have tracked down the culprit commit to this (cf. #1585) where a filter was adapted to filter out some files from the list of files to be copied. I can understand that you filter out the .git directory (at least I have not yet had a usecase for that), but please don't filter out .gitignore. I also think that .gitmodules should stay.
Indeed, the relevant test only tests for the removal of the .gitdirectory.

Note: The files have explicitly been included by a MANIFEST.in with a recursive-include mypgk/project_template * entry. If you want to generally remove all .gitignore files, maybe this can be used to ensure that explicitly whitelisted files still make it into the package.

Steps to Reproduce

  • Create a python package
  • Include a .gitignore file because you want to ship a nice git repo template
  • Observe that the .gitignore file is gone in the final package in conda-bld
Output of conda info
 conda info

     active environment : None
       user config file : C:\Users\buchner\.condarc
 populated config files : C:\Users\buchner\.condarc
          conda version : 4.5.0
    conda-build version : 3.7.1
         python version : 3.6.4.final.0
       base environment : C:\Continuum\anaconda3  (writable)
           channel URLs : <snip>
                          <snip>
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/win-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
                          https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : C:\Continuum\anaconda3\pkgs
                          C:\Users\buchner\AppData\Local\conda\conda\pkgs
       envs directories : C:\Continuum\anaconda3\envs
                          C:\Users\buchner\AppData\Local\conda\conda\envs
                          C:\Users\buchner\.conda\envs
               platform : win-64
             user-agent : conda/4.5.0 requests/2.18.4 CPython/3.6.4 Windows/10 Windows/10.0.16299
          administrator : False
             netrc file : None
           offline mode : False
@msarahan
Copy link
Contributor

This seems reasonable to me. Do you mind submitting a PR to make this change? It would go in https://github.com/conda/conda-build/blob/master/conda_build/utils.py#L1220-L1225 - looks like you may just need to remove some lines.

@bilderbuchi
Copy link
Contributor Author

sure. :-)

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Mar 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants