python setuptools compile fortran code and make an entry pointsHow can I make a time delay in Python?Explain Python entry points?Alternative implementations of python/setuptools entry points (extensions) in other languages/applicationsWhy does Python code run faster in a function?Cython and fortran - how to compile together without f2pyPython 3: ImportError “No Module named Setuptools”Post-install script with Python setuptoolsPython, setuptools, wheel, entry_points, .exe wrappers for Windows, and MultiprocessingOverride the shebang mangling in python setuptoolsConfused by setuptools “name” keyword parameter using Click module

If SWIFT is headquartered in Europe, why does the EU need to create a SWIFT alternative to be able to do transactions with Iran?

What is the German word or phrase for "village returning to forest"?

Cauchy reals and Dedekind reals satisfy "the same mathematical theorems"

Is this artwork (used in a video game) real?

How to ask my office to remove the pride decorations without appearing anti-LGBTQ?

Should I be able to keep my company purchased standing desk when I leave my job?

Can I remove the doors before installing a sliding patio doors frame?

Do I need a 50/60Hz notch filter for battery powered devices?

Get back to US from Canada without passport

How should one refer to knights (& dames) in academic writing?

FPGA CPU's, how to find the max speed?

What made Windows ME so crash-prone?

What happens on Day 6?

Is the Malay "garam" (salt) related to the Latin "garum" (fish sauce)?

Link of a singularity

What impact would a dragon the size of Asia have on the environment?

Can you perfectly wrap a cube with this blocky shape?

How fast does a character need to move to be effectively invisible?

A scene of Jimmy diversity

How to delete certain lists from a nested list?

Why doesn't philosophy have higher standards for its arguments?

When does Fisher's "go get more data" approach make sense?

Why does FFmpeg choose 10+20+20 ms instead of an even 16 ms for 60 fps GIF images?

Is straight-up writing someone's opinions telling?



python setuptools compile fortran code and make an entry points


How can I make a time delay in Python?Explain Python entry points?Alternative implementations of python/setuptools entry points (extensions) in other languages/applicationsWhy does Python code run faster in a function?Cython and fortran - how to compile together without f2pyPython 3: ImportError “No Module named Setuptools”Post-install script with Python setuptoolsPython, setuptools, wheel, entry_points, .exe wrappers for Windows, and MultiprocessingOverride the shebang mangling in python setuptoolsConfused by setuptools “name” keyword parameter using Click module






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















Here's my directory structure,



├── test
│ ├── test.f90
│ ├── __init__.py
│ └── test.py


Now I want to make a package from this with an command line tool test.
Now I have two options, 1. numpy distutils and 2. setuptools.



Problem with distutils is that it doesn't support entry points and it is also not recomended now. But it does compile the fortran code perfectly.
Now as for setuptools I'm trying to use this code,



mod = Extension(name = 'foo.adt', sources = ['test/test.f90'])
setup(
name = 'foo',
packages = ['foo'],
package_dir = 'foo':'test',
ext_modules = [mod],
entry_points=
'console_scripts': [
'hello = foo.test:main',
],

)


If I try to use this, it's throwing this error



error: unknown file type '.f90' (from 'test/test.f90')


So, I guess setuptools doesn't support fortran files? So, how do I compile the fortran code, create the package and create a entry point for that?










share|improve this question






























    2















    Here's my directory structure,



    ├── test
    │ ├── test.f90
    │ ├── __init__.py
    │ └── test.py


    Now I want to make a package from this with an command line tool test.
    Now I have two options, 1. numpy distutils and 2. setuptools.



    Problem with distutils is that it doesn't support entry points and it is also not recomended now. But it does compile the fortran code perfectly.
    Now as for setuptools I'm trying to use this code,



    mod = Extension(name = 'foo.adt', sources = ['test/test.f90'])
    setup(
    name = 'foo',
    packages = ['foo'],
    package_dir = 'foo':'test',
    ext_modules = [mod],
    entry_points=
    'console_scripts': [
    'hello = foo.test:main',
    ],

    )


    If I try to use this, it's throwing this error



    error: unknown file type '.f90' (from 'test/test.f90')


    So, I guess setuptools doesn't support fortran files? So, how do I compile the fortran code, create the package and create a entry point for that?










    share|improve this question


























      2












      2








      2








      Here's my directory structure,



      ├── test
      │ ├── test.f90
      │ ├── __init__.py
      │ └── test.py


      Now I want to make a package from this with an command line tool test.
      Now I have two options, 1. numpy distutils and 2. setuptools.



      Problem with distutils is that it doesn't support entry points and it is also not recomended now. But it does compile the fortran code perfectly.
      Now as for setuptools I'm trying to use this code,



      mod = Extension(name = 'foo.adt', sources = ['test/test.f90'])
      setup(
      name = 'foo',
      packages = ['foo'],
      package_dir = 'foo':'test',
      ext_modules = [mod],
      entry_points=
      'console_scripts': [
      'hello = foo.test:main',
      ],

      )


      If I try to use this, it's throwing this error



      error: unknown file type '.f90' (from 'test/test.f90')


      So, I guess setuptools doesn't support fortran files? So, how do I compile the fortran code, create the package and create a entry point for that?










      share|improve this question
















      Here's my directory structure,



      ├── test
      │ ├── test.f90
      │ ├── __init__.py
      │ └── test.py


      Now I want to make a package from this with an command line tool test.
      Now I have two options, 1. numpy distutils and 2. setuptools.



      Problem with distutils is that it doesn't support entry points and it is also not recomended now. But it does compile the fortran code perfectly.
      Now as for setuptools I'm trying to use this code,



      mod = Extension(name = 'foo.adt', sources = ['test/test.f90'])
      setup(
      name = 'foo',
      packages = ['foo'],
      package_dir = 'foo':'test',
      ext_modules = [mod],
      entry_points=
      'console_scripts': [
      'hello = foo.test:main',
      ],

      )


      If I try to use this, it's throwing this error



      error: unknown file type '.f90' (from 'test/test.f90')


      So, I guess setuptools doesn't support fortran files? So, how do I compile the fortran code, create the package and create a entry point for that?







      python numpy setuptools setup.py python-packaging






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 8:10









      Arne

      3,6762 gold badges25 silver badges47 bronze badges




      3,6762 gold badges25 silver badges47 bronze badges










      asked Mar 26 at 8:07









      EularEular

      5641 gold badge8 silver badges29 bronze badges




      5641 gold badge8 silver badges29 bronze badges






















          2 Answers
          2






          active

          oldest

          votes


















          1














          It's actually a pretty simple trick. Just import setuptools before importing setup from numpy.distutils.core and you're good to go. The explanation for this is that numpy.distutils is much more than just the vanilla distutils with some package-specific tweaks. In particular, numpy.distutils checks whether setuptools is available and if so, uses it where possible under the hood. If you're interested, look at the module's source code, paying attention to the usages of have_setuptools flag.



          As usual, a Minimal, Complete, and Verifiable example:



          so-55352409/
          ├── spam
          │ ├── __init__.py
          │ ├── cli.py
          │ └── libfib.f90
          └── setup.py



          setup.py:



          import setuptools # this is the "magic" import
          from numpy.distutils.core import setup, Extension


          lib = Extension(name='spam.libfib', sources=['spam/libfib.f90'])

          setup(
          name = 'spamlib',
          packages = ['spam'],
          ext_modules = [lib],
          entry_points=
          'console_scripts': [
          'hello = spam.cli:main',
          ],

          )



          spam/cli.py:



          from spam.libfib import fib


          def main():
          print(fib(10))



          spam/libfib.f90:



          C FILE: LIBFIB.F90
          SUBROUTINE FIB(A,N)
          C
          C CALCULATE FIRST N FIBONACCI NUMBERS
          C
          INTEGER N
          REAL*8 A(N)
          Cf2py intent(in) n
          Cf2py intent(out) a
          Cf2py depend(n) a
          DO I=1,N
          IF (I.EQ.1) THEN
          A(I) = 0.0D0
          ELSEIF (I.EQ.2) THEN
          A(I) = 1.0D0
          ELSE
          A(I) = A(I-1) + A(I-2)
          ENDIF
          ENDDO
          END
          C END FILE LIBFIB.F90


          Build and install the package:



          $ cd so-55352409
          $ python setup.py bdist_wheel
          ...
          $ pip install dist/spamlib-0.0.0-cp36-cp36m-linux_x86_64.whl
          ...
          $ hello
          [ 0. 1. 1. 2. 3. 5. 8. 13. 21. 34.]





          share|improve this answer























          • You saved my life !!!

            – Eular
            Mar 26 at 14:23











          • Glad I could help :-)

            – hoefling
            Mar 26 at 14:24











          • One question, why can't I just do from libfib import fib in the cli.py. If I have multiple files (say just plain python files), being imported multiple times with a complex folder structure then, do I have to iclude the package name in all the import statements ?

            – Eular
            Mar 26 at 18:37











          • You can arrange the imports however you want, just make sure the compiled extension is placed correctly. E.g. if you want to import libfib, pass name=libfib to extension object. You can also place from spam.libfib import fib in spam/__init__.py and the fib function will be available in all submodules of spam without an explicit import statement.

            – hoefling
            Mar 26 at 20:53


















          0














          Start by making a folder called test under src/ folder e.g.



          src
          -- <package>
          -- test
          --- ***


          Then add a MANIFEST.in and add



          recursive-include src/<package_name>/test *


          Have these two lines included in your setup.py



          from setuptools import setup, find_packages
          package_dir='': 'src',
          packages=find_packages('src'),


          for your console scripts, do



          entry_points=
          'console_scripts': [
          'hello=<package>.test:main',
          ],
          ,





          share|improve this answer

























          • can you please explain

            – Eular
            Mar 26 at 8:46











          • Check now updated

            – Devesh Kumar Singh
            Mar 26 at 9:03











          • can you explain what manifest.in actually doing?

            – Eular
            Mar 26 at 9:26











          • It is also explained here: docs.python.org/2/distutils/…. Also I found this here (docs.python.org/2/distutils/…) ``` anything that looks like a test script: test/test*.py (currently, the Distutils don’t do anything with test scripts except include them in source distributions, but in the future there will be a standard for testing Python module distributions) ``` So maybe you need to rename the foledr and files as something else

            – Devesh Kumar Singh
            Mar 26 at 9:36












          • My problem is distutils doesn't create entry_points and setuptools doesn't compile fortran code, how this answer is solving that?

            – Eular
            Mar 26 at 10:26













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55352409%2fpython-setuptools-compile-fortran-code-and-make-an-entry-points%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          It's actually a pretty simple trick. Just import setuptools before importing setup from numpy.distutils.core and you're good to go. The explanation for this is that numpy.distutils is much more than just the vanilla distutils with some package-specific tweaks. In particular, numpy.distutils checks whether setuptools is available and if so, uses it where possible under the hood. If you're interested, look at the module's source code, paying attention to the usages of have_setuptools flag.



          As usual, a Minimal, Complete, and Verifiable example:



          so-55352409/
          ├── spam
          │ ├── __init__.py
          │ ├── cli.py
          │ └── libfib.f90
          └── setup.py



          setup.py:



          import setuptools # this is the "magic" import
          from numpy.distutils.core import setup, Extension


          lib = Extension(name='spam.libfib', sources=['spam/libfib.f90'])

          setup(
          name = 'spamlib',
          packages = ['spam'],
          ext_modules = [lib],
          entry_points=
          'console_scripts': [
          'hello = spam.cli:main',
          ],

          )



          spam/cli.py:



          from spam.libfib import fib


          def main():
          print(fib(10))



          spam/libfib.f90:



          C FILE: LIBFIB.F90
          SUBROUTINE FIB(A,N)
          C
          C CALCULATE FIRST N FIBONACCI NUMBERS
          C
          INTEGER N
          REAL*8 A(N)
          Cf2py intent(in) n
          Cf2py intent(out) a
          Cf2py depend(n) a
          DO I=1,N
          IF (I.EQ.1) THEN
          A(I) = 0.0D0
          ELSEIF (I.EQ.2) THEN
          A(I) = 1.0D0
          ELSE
          A(I) = A(I-1) + A(I-2)
          ENDIF
          ENDDO
          END
          C END FILE LIBFIB.F90


          Build and install the package:



          $ cd so-55352409
          $ python setup.py bdist_wheel
          ...
          $ pip install dist/spamlib-0.0.0-cp36-cp36m-linux_x86_64.whl
          ...
          $ hello
          [ 0. 1. 1. 2. 3. 5. 8. 13. 21. 34.]





          share|improve this answer























          • You saved my life !!!

            – Eular
            Mar 26 at 14:23











          • Glad I could help :-)

            – hoefling
            Mar 26 at 14:24











          • One question, why can't I just do from libfib import fib in the cli.py. If I have multiple files (say just plain python files), being imported multiple times with a complex folder structure then, do I have to iclude the package name in all the import statements ?

            – Eular
            Mar 26 at 18:37











          • You can arrange the imports however you want, just make sure the compiled extension is placed correctly. E.g. if you want to import libfib, pass name=libfib to extension object. You can also place from spam.libfib import fib in spam/__init__.py and the fib function will be available in all submodules of spam without an explicit import statement.

            – hoefling
            Mar 26 at 20:53















          1














          It's actually a pretty simple trick. Just import setuptools before importing setup from numpy.distutils.core and you're good to go. The explanation for this is that numpy.distutils is much more than just the vanilla distutils with some package-specific tweaks. In particular, numpy.distutils checks whether setuptools is available and if so, uses it where possible under the hood. If you're interested, look at the module's source code, paying attention to the usages of have_setuptools flag.



          As usual, a Minimal, Complete, and Verifiable example:



          so-55352409/
          ├── spam
          │ ├── __init__.py
          │ ├── cli.py
          │ └── libfib.f90
          └── setup.py



          setup.py:



          import setuptools # this is the "magic" import
          from numpy.distutils.core import setup, Extension


          lib = Extension(name='spam.libfib', sources=['spam/libfib.f90'])

          setup(
          name = 'spamlib',
          packages = ['spam'],
          ext_modules = [lib],
          entry_points=
          'console_scripts': [
          'hello = spam.cli:main',
          ],

          )



          spam/cli.py:



          from spam.libfib import fib


          def main():
          print(fib(10))



          spam/libfib.f90:



          C FILE: LIBFIB.F90
          SUBROUTINE FIB(A,N)
          C
          C CALCULATE FIRST N FIBONACCI NUMBERS
          C
          INTEGER N
          REAL*8 A(N)
          Cf2py intent(in) n
          Cf2py intent(out) a
          Cf2py depend(n) a
          DO I=1,N
          IF (I.EQ.1) THEN
          A(I) = 0.0D0
          ELSEIF (I.EQ.2) THEN
          A(I) = 1.0D0
          ELSE
          A(I) = A(I-1) + A(I-2)
          ENDIF
          ENDDO
          END
          C END FILE LIBFIB.F90


          Build and install the package:



          $ cd so-55352409
          $ python setup.py bdist_wheel
          ...
          $ pip install dist/spamlib-0.0.0-cp36-cp36m-linux_x86_64.whl
          ...
          $ hello
          [ 0. 1. 1. 2. 3. 5. 8. 13. 21. 34.]





          share|improve this answer























          • You saved my life !!!

            – Eular
            Mar 26 at 14:23











          • Glad I could help :-)

            – hoefling
            Mar 26 at 14:24











          • One question, why can't I just do from libfib import fib in the cli.py. If I have multiple files (say just plain python files), being imported multiple times with a complex folder structure then, do I have to iclude the package name in all the import statements ?

            – Eular
            Mar 26 at 18:37











          • You can arrange the imports however you want, just make sure the compiled extension is placed correctly. E.g. if you want to import libfib, pass name=libfib to extension object. You can also place from spam.libfib import fib in spam/__init__.py and the fib function will be available in all submodules of spam without an explicit import statement.

            – hoefling
            Mar 26 at 20:53













          1












          1








          1







          It's actually a pretty simple trick. Just import setuptools before importing setup from numpy.distutils.core and you're good to go. The explanation for this is that numpy.distutils is much more than just the vanilla distutils with some package-specific tweaks. In particular, numpy.distutils checks whether setuptools is available and if so, uses it where possible under the hood. If you're interested, look at the module's source code, paying attention to the usages of have_setuptools flag.



          As usual, a Minimal, Complete, and Verifiable example:



          so-55352409/
          ├── spam
          │ ├── __init__.py
          │ ├── cli.py
          │ └── libfib.f90
          └── setup.py



          setup.py:



          import setuptools # this is the "magic" import
          from numpy.distutils.core import setup, Extension


          lib = Extension(name='spam.libfib', sources=['spam/libfib.f90'])

          setup(
          name = 'spamlib',
          packages = ['spam'],
          ext_modules = [lib],
          entry_points=
          'console_scripts': [
          'hello = spam.cli:main',
          ],

          )



          spam/cli.py:



          from spam.libfib import fib


          def main():
          print(fib(10))



          spam/libfib.f90:



          C FILE: LIBFIB.F90
          SUBROUTINE FIB(A,N)
          C
          C CALCULATE FIRST N FIBONACCI NUMBERS
          C
          INTEGER N
          REAL*8 A(N)
          Cf2py intent(in) n
          Cf2py intent(out) a
          Cf2py depend(n) a
          DO I=1,N
          IF (I.EQ.1) THEN
          A(I) = 0.0D0
          ELSEIF (I.EQ.2) THEN
          A(I) = 1.0D0
          ELSE
          A(I) = A(I-1) + A(I-2)
          ENDIF
          ENDDO
          END
          C END FILE LIBFIB.F90


          Build and install the package:



          $ cd so-55352409
          $ python setup.py bdist_wheel
          ...
          $ pip install dist/spamlib-0.0.0-cp36-cp36m-linux_x86_64.whl
          ...
          $ hello
          [ 0. 1. 1. 2. 3. 5. 8. 13. 21. 34.]





          share|improve this answer













          It's actually a pretty simple trick. Just import setuptools before importing setup from numpy.distutils.core and you're good to go. The explanation for this is that numpy.distutils is much more than just the vanilla distutils with some package-specific tweaks. In particular, numpy.distutils checks whether setuptools is available and if so, uses it where possible under the hood. If you're interested, look at the module's source code, paying attention to the usages of have_setuptools flag.



          As usual, a Minimal, Complete, and Verifiable example:



          so-55352409/
          ├── spam
          │ ├── __init__.py
          │ ├── cli.py
          │ └── libfib.f90
          └── setup.py



          setup.py:



          import setuptools # this is the "magic" import
          from numpy.distutils.core import setup, Extension


          lib = Extension(name='spam.libfib', sources=['spam/libfib.f90'])

          setup(
          name = 'spamlib',
          packages = ['spam'],
          ext_modules = [lib],
          entry_points=
          'console_scripts': [
          'hello = spam.cli:main',
          ],

          )



          spam/cli.py:



          from spam.libfib import fib


          def main():
          print(fib(10))



          spam/libfib.f90:



          C FILE: LIBFIB.F90
          SUBROUTINE FIB(A,N)
          C
          C CALCULATE FIRST N FIBONACCI NUMBERS
          C
          INTEGER N
          REAL*8 A(N)
          Cf2py intent(in) n
          Cf2py intent(out) a
          Cf2py depend(n) a
          DO I=1,N
          IF (I.EQ.1) THEN
          A(I) = 0.0D0
          ELSEIF (I.EQ.2) THEN
          A(I) = 1.0D0
          ELSE
          A(I) = A(I-1) + A(I-2)
          ENDIF
          ENDDO
          END
          C END FILE LIBFIB.F90


          Build and install the package:



          $ cd so-55352409
          $ python setup.py bdist_wheel
          ...
          $ pip install dist/spamlib-0.0.0-cp36-cp36m-linux_x86_64.whl
          ...
          $ hello
          [ 0. 1. 1. 2. 3. 5. 8. 13. 21. 34.]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 26 at 13:40









          hoeflinghoefling

          17.5k4 gold badges40 silver badges74 bronze badges




          17.5k4 gold badges40 silver badges74 bronze badges












          • You saved my life !!!

            – Eular
            Mar 26 at 14:23











          • Glad I could help :-)

            – hoefling
            Mar 26 at 14:24











          • One question, why can't I just do from libfib import fib in the cli.py. If I have multiple files (say just plain python files), being imported multiple times with a complex folder structure then, do I have to iclude the package name in all the import statements ?

            – Eular
            Mar 26 at 18:37











          • You can arrange the imports however you want, just make sure the compiled extension is placed correctly. E.g. if you want to import libfib, pass name=libfib to extension object. You can also place from spam.libfib import fib in spam/__init__.py and the fib function will be available in all submodules of spam without an explicit import statement.

            – hoefling
            Mar 26 at 20:53

















          • You saved my life !!!

            – Eular
            Mar 26 at 14:23











          • Glad I could help :-)

            – hoefling
            Mar 26 at 14:24











          • One question, why can't I just do from libfib import fib in the cli.py. If I have multiple files (say just plain python files), being imported multiple times with a complex folder structure then, do I have to iclude the package name in all the import statements ?

            – Eular
            Mar 26 at 18:37











          • You can arrange the imports however you want, just make sure the compiled extension is placed correctly. E.g. if you want to import libfib, pass name=libfib to extension object. You can also place from spam.libfib import fib in spam/__init__.py and the fib function will be available in all submodules of spam without an explicit import statement.

            – hoefling
            Mar 26 at 20:53
















          You saved my life !!!

          – Eular
          Mar 26 at 14:23





          You saved my life !!!

          – Eular
          Mar 26 at 14:23













          Glad I could help :-)

          – hoefling
          Mar 26 at 14:24





          Glad I could help :-)

          – hoefling
          Mar 26 at 14:24













          One question, why can't I just do from libfib import fib in the cli.py. If I have multiple files (say just plain python files), being imported multiple times with a complex folder structure then, do I have to iclude the package name in all the import statements ?

          – Eular
          Mar 26 at 18:37





          One question, why can't I just do from libfib import fib in the cli.py. If I have multiple files (say just plain python files), being imported multiple times with a complex folder structure then, do I have to iclude the package name in all the import statements ?

          – Eular
          Mar 26 at 18:37













          You can arrange the imports however you want, just make sure the compiled extension is placed correctly. E.g. if you want to import libfib, pass name=libfib to extension object. You can also place from spam.libfib import fib in spam/__init__.py and the fib function will be available in all submodules of spam without an explicit import statement.

          – hoefling
          Mar 26 at 20:53





          You can arrange the imports however you want, just make sure the compiled extension is placed correctly. E.g. if you want to import libfib, pass name=libfib to extension object. You can also place from spam.libfib import fib in spam/__init__.py and the fib function will be available in all submodules of spam without an explicit import statement.

          – hoefling
          Mar 26 at 20:53













          0














          Start by making a folder called test under src/ folder e.g.



          src
          -- <package>
          -- test
          --- ***


          Then add a MANIFEST.in and add



          recursive-include src/<package_name>/test *


          Have these two lines included in your setup.py



          from setuptools import setup, find_packages
          package_dir='': 'src',
          packages=find_packages('src'),


          for your console scripts, do



          entry_points=
          'console_scripts': [
          'hello=<package>.test:main',
          ],
          ,





          share|improve this answer

























          • can you please explain

            – Eular
            Mar 26 at 8:46











          • Check now updated

            – Devesh Kumar Singh
            Mar 26 at 9:03











          • can you explain what manifest.in actually doing?

            – Eular
            Mar 26 at 9:26











          • It is also explained here: docs.python.org/2/distutils/…. Also I found this here (docs.python.org/2/distutils/…) ``` anything that looks like a test script: test/test*.py (currently, the Distutils don’t do anything with test scripts except include them in source distributions, but in the future there will be a standard for testing Python module distributions) ``` So maybe you need to rename the foledr and files as something else

            – Devesh Kumar Singh
            Mar 26 at 9:36












          • My problem is distutils doesn't create entry_points and setuptools doesn't compile fortran code, how this answer is solving that?

            – Eular
            Mar 26 at 10:26















          0














          Start by making a folder called test under src/ folder e.g.



          src
          -- <package>
          -- test
          --- ***


          Then add a MANIFEST.in and add



          recursive-include src/<package_name>/test *


          Have these two lines included in your setup.py



          from setuptools import setup, find_packages
          package_dir='': 'src',
          packages=find_packages('src'),


          for your console scripts, do



          entry_points=
          'console_scripts': [
          'hello=<package>.test:main',
          ],
          ,





          share|improve this answer

























          • can you please explain

            – Eular
            Mar 26 at 8:46











          • Check now updated

            – Devesh Kumar Singh
            Mar 26 at 9:03











          • can you explain what manifest.in actually doing?

            – Eular
            Mar 26 at 9:26











          • It is also explained here: docs.python.org/2/distutils/…. Also I found this here (docs.python.org/2/distutils/…) ``` anything that looks like a test script: test/test*.py (currently, the Distutils don’t do anything with test scripts except include them in source distributions, but in the future there will be a standard for testing Python module distributions) ``` So maybe you need to rename the foledr and files as something else

            – Devesh Kumar Singh
            Mar 26 at 9:36












          • My problem is distutils doesn't create entry_points and setuptools doesn't compile fortran code, how this answer is solving that?

            – Eular
            Mar 26 at 10:26













          0












          0








          0







          Start by making a folder called test under src/ folder e.g.



          src
          -- <package>
          -- test
          --- ***


          Then add a MANIFEST.in and add



          recursive-include src/<package_name>/test *


          Have these two lines included in your setup.py



          from setuptools import setup, find_packages
          package_dir='': 'src',
          packages=find_packages('src'),


          for your console scripts, do



          entry_points=
          'console_scripts': [
          'hello=<package>.test:main',
          ],
          ,





          share|improve this answer















          Start by making a folder called test under src/ folder e.g.



          src
          -- <package>
          -- test
          --- ***


          Then add a MANIFEST.in and add



          recursive-include src/<package_name>/test *


          Have these two lines included in your setup.py



          from setuptools import setup, find_packages
          package_dir='': 'src',
          packages=find_packages('src'),


          for your console scripts, do



          entry_points=
          'console_scripts': [
          'hello=<package>.test:main',
          ],
          ,






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 26 at 9:02

























          answered Mar 26 at 8:41









          Devesh Kumar SinghDevesh Kumar Singh

          17.7k4 gold badges14 silver badges34 bronze badges




          17.7k4 gold badges14 silver badges34 bronze badges












          • can you please explain

            – Eular
            Mar 26 at 8:46











          • Check now updated

            – Devesh Kumar Singh
            Mar 26 at 9:03











          • can you explain what manifest.in actually doing?

            – Eular
            Mar 26 at 9:26











          • It is also explained here: docs.python.org/2/distutils/…. Also I found this here (docs.python.org/2/distutils/…) ``` anything that looks like a test script: test/test*.py (currently, the Distutils don’t do anything with test scripts except include them in source distributions, but in the future there will be a standard for testing Python module distributions) ``` So maybe you need to rename the foledr and files as something else

            – Devesh Kumar Singh
            Mar 26 at 9:36












          • My problem is distutils doesn't create entry_points and setuptools doesn't compile fortran code, how this answer is solving that?

            – Eular
            Mar 26 at 10:26

















          • can you please explain

            – Eular
            Mar 26 at 8:46











          • Check now updated

            – Devesh Kumar Singh
            Mar 26 at 9:03











          • can you explain what manifest.in actually doing?

            – Eular
            Mar 26 at 9:26











          • It is also explained here: docs.python.org/2/distutils/…. Also I found this here (docs.python.org/2/distutils/…) ``` anything that looks like a test script: test/test*.py (currently, the Distutils don’t do anything with test scripts except include them in source distributions, but in the future there will be a standard for testing Python module distributions) ``` So maybe you need to rename the foledr and files as something else

            – Devesh Kumar Singh
            Mar 26 at 9:36












          • My problem is distutils doesn't create entry_points and setuptools doesn't compile fortran code, how this answer is solving that?

            – Eular
            Mar 26 at 10:26
















          can you please explain

          – Eular
          Mar 26 at 8:46





          can you please explain

          – Eular
          Mar 26 at 8:46













          Check now updated

          – Devesh Kumar Singh
          Mar 26 at 9:03





          Check now updated

          – Devesh Kumar Singh
          Mar 26 at 9:03













          can you explain what manifest.in actually doing?

          – Eular
          Mar 26 at 9:26





          can you explain what manifest.in actually doing?

          – Eular
          Mar 26 at 9:26













          It is also explained here: docs.python.org/2/distutils/…. Also I found this here (docs.python.org/2/distutils/…) ``` anything that looks like a test script: test/test*.py (currently, the Distutils don’t do anything with test scripts except include them in source distributions, but in the future there will be a standard for testing Python module distributions) ``` So maybe you need to rename the foledr and files as something else

          – Devesh Kumar Singh
          Mar 26 at 9:36






          It is also explained here: docs.python.org/2/distutils/…. Also I found this here (docs.python.org/2/distutils/…) ``` anything that looks like a test script: test/test*.py (currently, the Distutils don’t do anything with test scripts except include them in source distributions, but in the future there will be a standard for testing Python module distributions) ``` So maybe you need to rename the foledr and files as something else

          – Devesh Kumar Singh
          Mar 26 at 9:36














          My problem is distutils doesn't create entry_points and setuptools doesn't compile fortran code, how this answer is solving that?

          – Eular
          Mar 26 at 10:26





          My problem is distutils doesn't create entry_points and setuptools doesn't compile fortran code, how this answer is solving that?

          – Eular
          Mar 26 at 10:26

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55352409%2fpython-setuptools-compile-fortran-code-and-make-an-entry-points%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현