Questions about packaging the first PyPi projectWhat is the difference between an 'sdist' .tar.gz distribution and an python egg?How do I find the location of my Python site-packages directory?How to upgrade all Python packages with pip?How can I make setuptools install a package that's not on PyPI?How to send a package to PyPi?About catching ANY exceptionInstalling specific package versions with pipFind all packages installed with easy_install/pip?Utility for releasing packages to PyPi?What to include in PyPi package?Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?

meaning of "educating the ice"?

German equivalent to "going down the rabbit hole"

How are the cards determined in an incomplete deck of many things?

Why do modes sound so different, although they are basically the same as a mode of another scale?

How can I portray a character with no fear of death, without them sounding utterly bored?

Problem with giving inputs to a function programmatically

Is Borg adaptation only temporary?

Divide Numbers by 0

Sum and average calculator

What is the definition of Product

Cheap oscilloscope showing 16 MHz square wave

How secure are public hashed passwords (with a salt)?

How to differentiate between two people with the same name in a story?

Can a human variant take proficiency in initiative?

Datasets of Large Molecules

How is the casino term "a high roller" commonly expressed in German?

Why do fuses burn at a specific current?

Do universities maintain secret textbooks?

How were US credit cards verified in-store in the 1980's?

Why didn't Thatcher give Hong Kong to Taiwan?

An alternative to "two column" geometry proofs

Why is Mitch McConnell blocking nominees to the Federal Election Commission?

Calculate Landau's function

Understanding GFCI configuration in basement



Questions about packaging the first PyPi project


What is the difference between an 'sdist' .tar.gz distribution and an python egg?How do I find the location of my Python site-packages directory?How to upgrade all Python packages with pip?How can I make setuptools install a package that's not on PyPI?How to send a package to PyPi?About catching ANY exceptionInstalling specific package versions with pipFind all packages installed with easy_install/pip?Utility for releasing packages to PyPi?What to include in PyPi package?Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?






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








0















Few days ago I've created a little project called pyblime and right now I was trying to figure out how to create a proper setup.py that allowed me to upload the "right stuff" to PyPi so users will be able to enjoy the project by using pip without doing anything "too fancy" like calling fancy custom dev scripts, right now the project tree structure looks like this:



│ .gitignore
│ configure.py
│ MANIFEST.in
│ README.md
│ requirements.txt
│ setup.py

├───data
│ ├───commands
│ │ comment.py
│ │ fold.py
│ │
│ ├───screenshots
│ │ test_simple.png
│ │ test_themes.gif
│ │
│ ├───st_build_3149
│ │ ├───syntax
│ │ └───themes
│ └───testfiles
├───docs
│ build.md
│ contributing.md
│ guidelines.md
│ usage.md

├───examples
│ demo_00.py
│ tutorials.py
│ tutorial_00.py
│ tutorial_01.py
│ tutorial_02.py
│ tutorial_03.py
│ tutorial_04.py
│ tutorial_05.py
│ tutorial_06.py

├───pyblime
│ utils.py
│ view.py
│ __init__.py

├───sublime_text
│ sublime.py
│ sublime_plugin.py

└───tests
run_all.py
test_scopes.py
test_view.py
x.py


Rather than 1 question, I've got few simple doubts:



  • What'd be the "standard" way to instruct setup.py to copy sublime_text/sublime.py and sublime_text/sublime_plugin.py files into Lib/site-packages root?

  • How'd you tell setup.py to copy the whole folder pyblime adhoc in Lib/site-packages?

  • Finally, is it correct to upload tests/examples/tests/docs/data to PyPi? This is, content that won't be necessary to use the SDK/library itself... If it's not, where would you include this type of data... I'm aware there exists the concept of sdist&dist folders and I've already read a bit about it here but the question still remains :)

Right now my setup.py looks something like this:



from pathlib import Path
from setuptools import setup

root_path = Path(__file__).parent
requirements = (root_path / "requirements.txt").read_text()
requirements = [
v for v in requirements.split("n")
if v.strip() and not v.strip().startswith("#")
]
readme = (root_path / "README.md").read_text()

setup(
author="mcve",
author_email="mcve",
classifiers=["mcve"],
description="mcve",
install_requires=requirements,
keywords=["mcve"],
long_description=(root_path / "README.md").read_text(),
name="mcve",
# package_data = , <---- How do i use this?
# packages = [], <---- Do I need to use this?
url="mcve",
version="0.0.1",
)


Ps. And yeah... I've already read the official docs out there about packaging... but if I had understood those docs I wouldn't be asking this on SO ;D . Thanks in advance!










share|improve this question






























    0















    Few days ago I've created a little project called pyblime and right now I was trying to figure out how to create a proper setup.py that allowed me to upload the "right stuff" to PyPi so users will be able to enjoy the project by using pip without doing anything "too fancy" like calling fancy custom dev scripts, right now the project tree structure looks like this:



    │ .gitignore
    │ configure.py
    │ MANIFEST.in
    │ README.md
    │ requirements.txt
    │ setup.py

    ├───data
    │ ├───commands
    │ │ comment.py
    │ │ fold.py
    │ │
    │ ├───screenshots
    │ │ test_simple.png
    │ │ test_themes.gif
    │ │
    │ ├───st_build_3149
    │ │ ├───syntax
    │ │ └───themes
    │ └───testfiles
    ├───docs
    │ build.md
    │ contributing.md
    │ guidelines.md
    │ usage.md

    ├───examples
    │ demo_00.py
    │ tutorials.py
    │ tutorial_00.py
    │ tutorial_01.py
    │ tutorial_02.py
    │ tutorial_03.py
    │ tutorial_04.py
    │ tutorial_05.py
    │ tutorial_06.py

    ├───pyblime
    │ utils.py
    │ view.py
    │ __init__.py

    ├───sublime_text
    │ sublime.py
    │ sublime_plugin.py

    └───tests
    run_all.py
    test_scopes.py
    test_view.py
    x.py


    Rather than 1 question, I've got few simple doubts:



    • What'd be the "standard" way to instruct setup.py to copy sublime_text/sublime.py and sublime_text/sublime_plugin.py files into Lib/site-packages root?

    • How'd you tell setup.py to copy the whole folder pyblime adhoc in Lib/site-packages?

    • Finally, is it correct to upload tests/examples/tests/docs/data to PyPi? This is, content that won't be necessary to use the SDK/library itself... If it's not, where would you include this type of data... I'm aware there exists the concept of sdist&dist folders and I've already read a bit about it here but the question still remains :)

    Right now my setup.py looks something like this:



    from pathlib import Path
    from setuptools import setup

    root_path = Path(__file__).parent
    requirements = (root_path / "requirements.txt").read_text()
    requirements = [
    v for v in requirements.split("n")
    if v.strip() and not v.strip().startswith("#")
    ]
    readme = (root_path / "README.md").read_text()

    setup(
    author="mcve",
    author_email="mcve",
    classifiers=["mcve"],
    description="mcve",
    install_requires=requirements,
    keywords=["mcve"],
    long_description=(root_path / "README.md").read_text(),
    name="mcve",
    # package_data = , <---- How do i use this?
    # packages = [], <---- Do I need to use this?
    url="mcve",
    version="0.0.1",
    )


    Ps. And yeah... I've already read the official docs out there about packaging... but if I had understood those docs I wouldn't be asking this on SO ;D . Thanks in advance!










    share|improve this question


























      0












      0








      0








      Few days ago I've created a little project called pyblime and right now I was trying to figure out how to create a proper setup.py that allowed me to upload the "right stuff" to PyPi so users will be able to enjoy the project by using pip without doing anything "too fancy" like calling fancy custom dev scripts, right now the project tree structure looks like this:



      │ .gitignore
      │ configure.py
      │ MANIFEST.in
      │ README.md
      │ requirements.txt
      │ setup.py

      ├───data
      │ ├───commands
      │ │ comment.py
      │ │ fold.py
      │ │
      │ ├───screenshots
      │ │ test_simple.png
      │ │ test_themes.gif
      │ │
      │ ├───st_build_3149
      │ │ ├───syntax
      │ │ └───themes
      │ └───testfiles
      ├───docs
      │ build.md
      │ contributing.md
      │ guidelines.md
      │ usage.md

      ├───examples
      │ demo_00.py
      │ tutorials.py
      │ tutorial_00.py
      │ tutorial_01.py
      │ tutorial_02.py
      │ tutorial_03.py
      │ tutorial_04.py
      │ tutorial_05.py
      │ tutorial_06.py

      ├───pyblime
      │ utils.py
      │ view.py
      │ __init__.py

      ├───sublime_text
      │ sublime.py
      │ sublime_plugin.py

      └───tests
      run_all.py
      test_scopes.py
      test_view.py
      x.py


      Rather than 1 question, I've got few simple doubts:



      • What'd be the "standard" way to instruct setup.py to copy sublime_text/sublime.py and sublime_text/sublime_plugin.py files into Lib/site-packages root?

      • How'd you tell setup.py to copy the whole folder pyblime adhoc in Lib/site-packages?

      • Finally, is it correct to upload tests/examples/tests/docs/data to PyPi? This is, content that won't be necessary to use the SDK/library itself... If it's not, where would you include this type of data... I'm aware there exists the concept of sdist&dist folders and I've already read a bit about it here but the question still remains :)

      Right now my setup.py looks something like this:



      from pathlib import Path
      from setuptools import setup

      root_path = Path(__file__).parent
      requirements = (root_path / "requirements.txt").read_text()
      requirements = [
      v for v in requirements.split("n")
      if v.strip() and not v.strip().startswith("#")
      ]
      readme = (root_path / "README.md").read_text()

      setup(
      author="mcve",
      author_email="mcve",
      classifiers=["mcve"],
      description="mcve",
      install_requires=requirements,
      keywords=["mcve"],
      long_description=(root_path / "README.md").read_text(),
      name="mcve",
      # package_data = , <---- How do i use this?
      # packages = [], <---- Do I need to use this?
      url="mcve",
      version="0.0.1",
      )


      Ps. And yeah... I've already read the official docs out there about packaging... but if I had understood those docs I wouldn't be asking this on SO ;D . Thanks in advance!










      share|improve this question














      Few days ago I've created a little project called pyblime and right now I was trying to figure out how to create a proper setup.py that allowed me to upload the "right stuff" to PyPi so users will be able to enjoy the project by using pip without doing anything "too fancy" like calling fancy custom dev scripts, right now the project tree structure looks like this:



      │ .gitignore
      │ configure.py
      │ MANIFEST.in
      │ README.md
      │ requirements.txt
      │ setup.py

      ├───data
      │ ├───commands
      │ │ comment.py
      │ │ fold.py
      │ │
      │ ├───screenshots
      │ │ test_simple.png
      │ │ test_themes.gif
      │ │
      │ ├───st_build_3149
      │ │ ├───syntax
      │ │ └───themes
      │ └───testfiles
      ├───docs
      │ build.md
      │ contributing.md
      │ guidelines.md
      │ usage.md

      ├───examples
      │ demo_00.py
      │ tutorials.py
      │ tutorial_00.py
      │ tutorial_01.py
      │ tutorial_02.py
      │ tutorial_03.py
      │ tutorial_04.py
      │ tutorial_05.py
      │ tutorial_06.py

      ├───pyblime
      │ utils.py
      │ view.py
      │ __init__.py

      ├───sublime_text
      │ sublime.py
      │ sublime_plugin.py

      └───tests
      run_all.py
      test_scopes.py
      test_view.py
      x.py


      Rather than 1 question, I've got few simple doubts:



      • What'd be the "standard" way to instruct setup.py to copy sublime_text/sublime.py and sublime_text/sublime_plugin.py files into Lib/site-packages root?

      • How'd you tell setup.py to copy the whole folder pyblime adhoc in Lib/site-packages?

      • Finally, is it correct to upload tests/examples/tests/docs/data to PyPi? This is, content that won't be necessary to use the SDK/library itself... If it's not, where would you include this type of data... I'm aware there exists the concept of sdist&dist folders and I've already read a bit about it here but the question still remains :)

      Right now my setup.py looks something like this:



      from pathlib import Path
      from setuptools import setup

      root_path = Path(__file__).parent
      requirements = (root_path / "requirements.txt").read_text()
      requirements = [
      v for v in requirements.split("n")
      if v.strip() and not v.strip().startswith("#")
      ]
      readme = (root_path / "README.md").read_text()

      setup(
      author="mcve",
      author_email="mcve",
      classifiers=["mcve"],
      description="mcve",
      install_requires=requirements,
      keywords=["mcve"],
      long_description=(root_path / "README.md").read_text(),
      name="mcve",
      # package_data = , <---- How do i use this?
      # packages = [], <---- Do I need to use this?
      url="mcve",
      version="0.0.1",
      )


      Ps. And yeah... I've already read the official docs out there about packaging... but if I had understood those docs I wouldn't be asking this on SO ;D . Thanks in advance!







      python packaging pypi pyblime






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 0:38









      BPLBPL

      4,5684 gold badges21 silver badges70 bronze badges




      4,5684 gold badges21 silver badges70 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          2















          Well, let's step by step.




          For the first question. Mostly you shouldn't do that, instead, you should consider sublime_text as a package too. The structure should look like:



          ├───sublime_text
          | __init__.py
          │ sublime.py
          │ sublime_plugin.py


          And you should use it like from sublime_text import sublime in your other packages. That's could be better as you won't pollute the global namespace too much. Or if this is not a common package that you want to share between many other packages, you can directly include it as a submodule in your main package.



          Or if you really wanna do this, you can place those two files in the root directory and use:



          ...
          packages = find_packages(),
          py_modules=["sublime", "sublime_plugin"],
          ...



          For the second question. As that is a package, you can add that path to packages: packages=[""]. Or for convenience, you can use packages=find_packages(). It will help you to find all packages under the current directory which is "".




          For your third question. Mostly it is not correct, you just need to submit what user needs to the PyPi. For docs, you should use readthedocs website. And for other examples and tests, just leave them on your Github. That's enough.






          share|improve this answer


























            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%2f55388526%2fquestions-about-packaging-the-first-pypi-project%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2















            Well, let's step by step.




            For the first question. Mostly you shouldn't do that, instead, you should consider sublime_text as a package too. The structure should look like:



            ├───sublime_text
            | __init__.py
            │ sublime.py
            │ sublime_plugin.py


            And you should use it like from sublime_text import sublime in your other packages. That's could be better as you won't pollute the global namespace too much. Or if this is not a common package that you want to share between many other packages, you can directly include it as a submodule in your main package.



            Or if you really wanna do this, you can place those two files in the root directory and use:



            ...
            packages = find_packages(),
            py_modules=["sublime", "sublime_plugin"],
            ...



            For the second question. As that is a package, you can add that path to packages: packages=[""]. Or for convenience, you can use packages=find_packages(). It will help you to find all packages under the current directory which is "".




            For your third question. Mostly it is not correct, you just need to submit what user needs to the PyPi. For docs, you should use readthedocs website. And for other examples and tests, just leave them on your Github. That's enough.






            share|improve this answer































              2















              Well, let's step by step.




              For the first question. Mostly you shouldn't do that, instead, you should consider sublime_text as a package too. The structure should look like:



              ├───sublime_text
              | __init__.py
              │ sublime.py
              │ sublime_plugin.py


              And you should use it like from sublime_text import sublime in your other packages. That's could be better as you won't pollute the global namespace too much. Or if this is not a common package that you want to share between many other packages, you can directly include it as a submodule in your main package.



              Or if you really wanna do this, you can place those two files in the root directory and use:



              ...
              packages = find_packages(),
              py_modules=["sublime", "sublime_plugin"],
              ...



              For the second question. As that is a package, you can add that path to packages: packages=[""]. Or for convenience, you can use packages=find_packages(). It will help you to find all packages under the current directory which is "".




              For your third question. Mostly it is not correct, you just need to submit what user needs to the PyPi. For docs, you should use readthedocs website. And for other examples and tests, just leave them on your Github. That's enough.






              share|improve this answer





























                2














                2










                2









                Well, let's step by step.




                For the first question. Mostly you shouldn't do that, instead, you should consider sublime_text as a package too. The structure should look like:



                ├───sublime_text
                | __init__.py
                │ sublime.py
                │ sublime_plugin.py


                And you should use it like from sublime_text import sublime in your other packages. That's could be better as you won't pollute the global namespace too much. Or if this is not a common package that you want to share between many other packages, you can directly include it as a submodule in your main package.



                Or if you really wanna do this, you can place those two files in the root directory and use:



                ...
                packages = find_packages(),
                py_modules=["sublime", "sublime_plugin"],
                ...



                For the second question. As that is a package, you can add that path to packages: packages=[""]. Or for convenience, you can use packages=find_packages(). It will help you to find all packages under the current directory which is "".




                For your third question. Mostly it is not correct, you just need to submit what user needs to the PyPi. For docs, you should use readthedocs website. And for other examples and tests, just leave them on your Github. That's enough.






                share|improve this answer















                Well, let's step by step.




                For the first question. Mostly you shouldn't do that, instead, you should consider sublime_text as a package too. The structure should look like:



                ├───sublime_text
                | __init__.py
                │ sublime.py
                │ sublime_plugin.py


                And you should use it like from sublime_text import sublime in your other packages. That's could be better as you won't pollute the global namespace too much. Or if this is not a common package that you want to share between many other packages, you can directly include it as a submodule in your main package.



                Or if you really wanna do this, you can place those two files in the root directory and use:



                ...
                packages = find_packages(),
                py_modules=["sublime", "sublime_plugin"],
                ...



                For the second question. As that is a package, you can add that path to packages: packages=[""]. Or for convenience, you can use packages=find_packages(). It will help you to find all packages under the current directory which is "".




                For your third question. Mostly it is not correct, you just need to submit what user needs to the PyPi. For docs, you should use readthedocs website. And for other examples and tests, just leave them on your Github. That's enough.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 28 at 4:38

























                answered Mar 28 at 2:06









                SrawSraw

                9,5043 gold badges17 silver badges48 bronze badges




                9,5043 gold badges17 silver badges48 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    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%2f55388526%2fquestions-about-packaging-the-first-pypi-project%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

                    Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

                    밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

                    1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴