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

fix pip install #1686

Merged
merged 1 commit into from
Jul 12, 2021
Merged

fix pip install #1686

merged 1 commit into from
Jul 12, 2021

Conversation

epassaro
Copy link
Member

@epassaro epassaro commented Jul 2, 2021

Description

Fixes the pip install ... command. Some examples:

  • pip install git+https://github.com/tardis-sn/tardis.git
  • pip install . (equivalent to python setup.py install )
  • pip install -e . (equivalent to python setup.py develop)

To achieve this I needed to undo some changes made in #1674 related to the tardis script. Now that script is considered a pure Python script instead of an entry point.

Motivation and context

We had two scripts folder before APE 17 migration:

  • thescripts/ (containing just the tardis UNIX script)
  • and tardis/scripts (Python entry points)

In #1674 made some changes to the tardis script to use it as an entry point. But seems that worked for python setup.py develop, but didn't worked for pip install . (required by the conda-forge packaging system, see here).

I reverted those changes plus some minor changes to make the script tidier.

You can try the result of pip install . on this branch and compare it with master.

Fixes #1211

How has this been tested?

  • Testing pipeline.
  • Other.

Locally.

Examples

Type of change

  • Bug fix.
  • New feature.
  • Breaking change.
  • None of the above.

Checklist

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
    • (optional) I have built the documentation on my fork following the instructions.
  • I have assigned and requested two reviewers for this pull request.

@tardis-bot
Copy link
Contributor

Before a pull request is accepted, it must meet the following criteria:

  • Is the necessary information provided?
  • Is this a duplicate PR?
    • If a new PR is clearly a duplicate, ask how this PR is different from the original PR?
    • If this PR is about to be merged, close the original PR with a link to this new PR that solved the issue.
  • Does it pass existing tests and are new tests provided if required?
    • The test coverage should not decrease, and for new features should be close to 100%.
  • Is the code tidy?
    • No unnecessary print lines or code comments.

@codecov
Copy link

codecov bot commented Jul 2, 2021

Codecov Report

Merging #1686 (20d44bc) into master (cc0410e) will increase coverage by 0.57%.
The diff coverage is n/a.

❗ Current head 20d44bc differs from pull request most recent head 1721634. Consider uploading reports for the commit 1721634 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1686      +/-   ##
==========================================
+ Coverage   61.29%   61.86%   +0.57%     
==========================================
  Files          63       62       -1     
  Lines        5792     5738      -54     
==========================================
  Hits         3550     3550              
+ Misses       2242     2188      -54     
Impacted Files Coverage Δ
tardis/tardis/scripts/tardis.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc0410e...1721634. Read the comment docs.

@yuyizheng1112
Copy link
Contributor

There is no .py extension after tardis/scripts/tardis. Is it on purpose?

@epassaro
Copy link
Member Author

epassaro commented Jul 8, 2021

There is no .py extension after tardis/scripts/tardis. Is it on purpose?

Yes. At the header of that file, you can see #!/usr/bin/env python which tells the script which interpreter should use. This script is intended to be used by typing tardis on the command line (without the extension).

@@ -1,13 +1,25 @@
#!/usr/bin/env python
Copy link
Member

@jaladh-singhal jaladh-singhal Jul 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it how this file is related to pip install?

It seems like it makes tardis runnable via CLI - is that so?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some context:

We had two scripts folder before APE 17 migration:

  • thescripts/ (containing just the tardis UNIX script)
  • and tardis/scripts (Python entry points)

In #1674 made some changes to the tardis script to use it as an entry point. But seems that worked for python setup.py develop, but didn't worked for pip install . (required by the conda-forge packaging system, see here).

I reverted those changes plus some minor changes to make the script tidier.

You can try the result of pip install . on this branch and compare it with master.

@epassaro epassaro requested a review from jaladh-singhal July 12, 2021 17:20
@wkerzendorf wkerzendorf merged commit 60cd602 into tardis-sn:master Jul 12, 2021
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this pull request Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't install TARDIS with pip
6 participants