A sample project that exists for PyPUG's "Tutorial on Packaging and Distributing Projects"

Overview

A sample Python project

Python Logo

A sample project that exists as an aid to the Python Packaging User Guide's Tutorial on Packaging and Distributing Projects.

This project does not aim to cover best practices for Python project development as a whole. For example, it does not provide guidance or tool recommendations for version control, documentation, or testing.

The source for this project is available here.

Most of the configuration for a Python project is done in the setup.py file, an example of which is included in this project. You should edit this file accordingly to adapt this sample project to your needs.


This is the README file for the project.

The file should use UTF-8 encoding and can be written using reStructuredText or markdown with the appropriate key set. It will be used to generate the project webpage on PyPI and will be displayed as the project homepage on common code-hosting services, and should be written for that purpose.

Typical contents for this file would include an overview of the project, basic usage examples, etc. Generally, including the project changelog in here is not a good idea, although a simple “What's New” section for the most recent version may be appropriate.

Comments
  • Move to metadata to `pyproject.toml`

    Move to metadata to `pyproject.toml`

    Now that PEP 621 support has been merged in https://github.com/pypa/setuptools/pull/2970, we can move project metadata into pyproject.toml and get rid of setup.py and setup.cfg.

    The one 'regression' is that external data files are deprecated (https://setuptools.pypa.io/en/latest/userguide/datafiles.html) so support has been removed here.

    This should remain a draft PR until https://github.com/pypa/setuptools/issues/2816 is resolved and editable installs work.

    Closes #56, closes #57, closes #96.

    opened by di 25
  • neither package_data or data_files get installed

    neither package_data or data_files get installed

    I have tried this on Python 2.7.5 and Python 3.4.3 and am unable to see package_data.dat or data_file installed anywhere when I do "python setup.py install" If I change to distutils it works fine.

    opened by ericfrederich 25
  • setup.py imports its own package

    setup.py imports its own package "sample"

    opened by gotgenes 23
  • Switch to setup.cfg for metadata?

    Switch to setup.cfg for metadata?

    Looking at the setuptools documentation, it seems that it's now possible to put project's metadata in setup.cfg (see http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files). I don't know when this was introduced, but would it make sense to switch to this approach as the recommended method?

    @jaraco Any comments? I don't know when this ability was introduced to setuptools, but it looks really easy to use, and (as far as I'm aware) didn't get as much publicity as maybe it should have...?

    question 
    opened by pfmoore 19
  • separating dependencies into requirements*.txt?

    separating dependencies into requirements*.txt?

    An example is at:

    https://github.com/pydata/pandas-datareader/blob/master/setup.py#L17

    Please let me know if you are open to a PR updating setup.py as above.

    opened by gliptak 14
  • Include LICENSE.txt in wheel

    Include LICENSE.txt in wheel

    Initially, I thought a file with the name LICENSE.txt would be included by default.

    Before:

    $ python setup.py bdist_wheel
    ...
    $ python setup.py bdist_wheel
    adding 'sample\__init__.py'
    adding 'sample\package_data.dat'
    adding 'sampleproject-1.2.0.data\data\my_data\data_file'
    adding 'sampleproject-1.2.0.dist-info\DESCRIPTION.rst'
    adding 'sampleproject-1.2.0.dist-info\entry_points.txt'
    adding 'sampleproject-1.2.0.dist-info\metadata.json'
    adding 'sampleproject-1.2.0.dist-info\top_level.txt'
    adding 'sampleproject-1.2.0.dist-info\WHEEL'
    adding 'sampleproject-1.2.0.dist-info\METADATA'
    adding 'sampleproject-1.2.0.dist-info\RECORD'
    

    After:

    $ python setup.py bdist_wheel
    ...
    adding 'sample\__init__.py'
    adding 'sample\package_data.dat'
    adding 'sampleproject-1.2.0.data\data\my_data\data_file'
    adding 'sampleproject-1.2.0.dist-info\DESCRIPTION.rst'
    adding 'sampleproject-1.2.0.dist-info\LICENSE.txt'
    adding 'sampleproject-1.2.0.dist-info\entry_points.txt'
    adding 'sampleproject-1.2.0.dist-info\metadata.json'
    adding 'sampleproject-1.2.0.dist-info\top_level.txt'
    adding 'sampleproject-1.2.0.dist-info\WHEEL'
    adding 'sampleproject-1.2.0.dist-info\METADATA'
    adding 'sampleproject-1.2.0.dist-info\RECORD'
    
    opened by xflr6 14
  • Add comment about where to get SPDX License identifier

    Add comment about where to get SPDX License identifier

    Currently the setup.py file says to choose a license but doesn't give a hint as to what type of value should go in the license argument.

    This patch adds to the comment a link to the Software Package Data Exchange license list which is where the license values are standardized.

    opened by gene1wood 11
  • Expand on the testing directory

    Expand on the testing directory

    We should probably flesh out the tests directory a bit (although it's going to be hard to avoid getting into "my favourite test package" debates...)

    • Does the tests directory need __init__.py? (Yes, for some test tools, so probably should be there).
    • How are tests run? Will setup.py test work? Does anyone actually use that? Should we include a (cross-platform) test runner script?
    • Do we need a note in README.txt recommending pip install -e when running tests, or should the test runner script just set sys.path?

    I think we probably should recommend a testing package, specifically unittest. It's another one of those "give a basic recommendation that people can evaluate once they have experience" issues.

    We need to sort out getting the tests directory into the sdist. The MANIFEST.in has a stab at it, but I'm not sure it works. I raised a question about this on pypa-dev (in the long thread on this project) but didn't get a satisfactory answer...

    opened by pfmoore 11
  • Demonstrate python_requires usage

    Demonstrate python_requires usage

    It would be useful if the sample setup.py demonstrated how to use python_requires to describe the versions of Python your project supports.

    I understand python_requires is a new feature of Pip, but I didn't realise it existed: I actually assumed that Pip used the Programming Lange :: Python classifiers to determine the Python versions supported, and published a "Python3-only" package which was still installable on Python 2 as a result.

    It'd be useful if the sample demonstrated python_requires, and clarified that the classifiers are recommendations only (for humans to read), while python_requires is actually checked by Pip before installing.

    opened by ncraike 9
  • add tox.ini and .travis.yml

    add tox.ini and .travis.yml

    many people use tox and travis, right?

    maybe this is "feature creep" for the point of this project, but I don't know.
    I'm inclined to add it.

    opened by qwcode 9
  • No module named 'candlestick.patterns'

    No module named 'candlestick.patterns'

    Hi!

    Thank you for the good work on this package.

    When I am trying to follow the example, it pops an error.

    from candlestick import candlestick df = candlestick.inverted_hammer(df, target='result')

    Can you please help me with this issue? Thank you.

    (Python3.8 in Windows.)

    Traceback (most recent call last): File "C:\My Documents\Scripts\WSS 20200323\G.py", line 8, in <module> df = candlestick.inverted_hammer(df, target='result') File "C:\Python38\lib\site-packages\candlestick\candlestick.py", line 138, in inverted_hammer cndl = __create_object('InvertedHammer', target) File "C:\Python38\lib\site-packages\candlestick\candlestick.py", line 35, in __create_object return __get_class_by_name(class_name)(target=target) File "C:\Python38\lib\site-packages\candlestick\candlestick.py", line 27, in __get_class_by_name module = __load_module(mod_name) File "C:\Python38\lib\site-packages\candlestick\candlestick.py", line 19, in __load_module raise e File "C:\Python38\lib\site-packages\candlestick\candlestick.py", line 16, in __load_module module = __import__(module_path, fromlist=[super_module], level=0) ModuleNotFoundError: No module named 'candlestick.patterns' [Finished in 1.8s]

    opened by P-Rainbow 8
  • How do you test this?

    How do you test this?

    Both python tests/test_simple.py and python -m unittest discover throw errors because of the import

      File "sampleproject/tests/test_simple.py", line 7, in <module>
        from sample.simple import add_one
    ModuleNotFoundError: No module named 'sample'
    

    So what's the correct way to test this package and other packages while in development?

    opened by myarcana 1
  • sample script does not run

    sample script does not run

    When I try to run an installed version of the sample script I get the error

    Traceback (most recent call last):
      File "/home/bradbell/prefix/sampleproject/bin/sample", line 33, in <module>
        sys.exit(load_entry_point('sampleproject==2.0.0', 'console_scripts', 'sample')())
      File "/home/bradbell/prefix/sampleproject/bin/sample", line 22, in importlib_load_entry_point
        for entry_point in distribution(dist_name).entry_points
      File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 919, in distribution
        return Distribution.from_name(distribution_name)
      File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 518, in from_name
        raise PackageNotFoundError(name)
    importlib.metadata.PackageNotFoundError: No package metadata was found for sampleproject
    

    Steps to reproduce:

    1. git clone https://github.com/pypa/sampleproject/ sampleproject.git
    2. cd sampelproject.git
    3. python setup.py install --prefix=$HOME/prefix/sampleproject
    4. program=$(find $HOME/prefix/sampleproject -name sample)
    5. pylib=$(find $HOME/prefix/sampleproject -name site-packages)
    6. export PYTHONPATH="$pylib:$PYTHONPATH"
    7. $program
    opened by bradbell 4
  • Add a `sampleproject/__main__.py` example

    Add a `sampleproject/__main__.py` example

    __main__.py is frequently used by packages and modules (like the standard turtledemo) to enable things like:

    python -m some_module
    

    I would like to propose a __main__.py example inside src/sampleproject, as a reference for new developers. I know that any change must be documented, but I don't think it would be really hard to do.

    Also, if you like this idea, tell me, and I can open a pull request.

    enhancement 
    opened by DiddiLeija 3
  • tests, test?

    tests, test?

    pypa/sampleproject and Python Packaging User Guide's "Packaging Python Projects" page suggest the unit test folder be named tests. But by default, all files matching the pattern test/test*.py, not tests/test*.py, are included in the source distribution. Indeed, I renamed tests to test in sampleproject, then python setup.py sdist bdist_wheel will create a dist package that includes test/test*.py.

    Or, did sampleproject intentionally change the name to avoid sdist's inclusion of the test files? That'd be a weird way to do so. It would be better to rename it back to test and explicitly put an exclude line in MANIFEST.in if you want the exclusion.

    opened by tomchen 5
  • Can this project be considered as the official or the standard form for create python packages?

    Can this project be considered as the official or the standard form for create python packages?

    it's more a question than a real issue, I know there are some alternatives based on cookiecutter for example, but can this be taked as a good starting point, or only serves as a reference for the Python Packaging Tutorial.

    Thanks.

    question 
    opened by oscarmcm 4
Toolkit for Machine Learning, Natural Language Processing, and Text Generation, in TensorFlow. This is part of the CASL project: http://casl-project.ai/

Texar is a toolkit aiming to support a broad set of machine learning, especially natural language processing and text generation tasks. Texar provides

ASYML 2.1k Feb 17, 2021
Integrating the Best of TF into PyTorch, for Machine Learning, Natural Language Processing, and Text Generation. This is part of the CASL project: http://casl-project.ai/

Texar-PyTorch is a toolkit aiming to support a broad set of machine learning, especially natural language processing and text generation tasks. Texar

ASYML 726 Dec 30, 2022
Chinese NewsTitle Generation Project by GPT2.带有超级详细注释的中文GPT2新闻标题生成项目。

GPT2-NewsTitle 带有超详细注释的GPT2新闻标题生成项目 UpDate 01.02.2021 从网上收集数据,将清华新闻数据、搜狗新闻数据等新闻数据集,以及开源的一些摘要数据进行整理清洗,构建一个较完善的中文摘要数据集。 数据集清洗时,仅进行了简单地规则清洗。

logCong 785 Dec 29, 2022
Demo programs for the Talking Head Anime from a Single Image 2: More Expressive project.

Demo Code for "Talking Head Anime from a Single Image 2: More Expressive" This repository contains demo programs for the Talking Head Anime

Pramook Khungurn 901 Jan 6, 2023
This project is part of Eleuther AI's quest to create a massive repository of high quality text data for training language models.

This project is part of Eleuther AI's quest to create a massive repository of high quality text data for training language models.

EleutherAI 42 Dec 13, 2022
NLPretext packages in a unique library all the text preprocessing functions you need to ease your NLP project.

NLPretext packages in a unique library all the text preprocessing functions you need to ease your NLP project.

Artefact 114 Dec 15, 2022
Mirco Ravanelli 2.3k Dec 27, 2022
This repository contains all the source code that is needed for the project : An Efficient Pipeline For Bloom’s Taxonomy Using Natural Language Processing and Deep Learning

Pipeline For NLP with Bloom's Taxonomy Using Improved Question Classification and Question Generation using Deep Learning This repository contains all

Rohan Mathur 9 Jul 17, 2021
Outreachy TFX custom component project

Schema Curation Custom Component Outreachy TFX custom component project This repo contains the code for Schema Curation Custom Component made as a par

Robert Crowe 5 Jul 16, 2021
Learn meanings behind words is a key element in NLP. This project concentrates on the disambiguation of preposition senses. Therefore, we train a bert-transformer model and surpass the state-of-the-art.

New State-of-the-Art in Preposition Sense Disambiguation Supervisor: Prof. Dr. Alexander Mehler Alexander Henlein Institutions: Goethe University TTLa

Dirk Neuhäuser 4 Apr 6, 2022
The simple project to separate mixed voice (2 clean voices) to 2 separate voices.

Speech Separation The simple project to separate mixed voice (2 clean voices) to 2 separate voices. Result Example (Clisk to hear the voices): mix ||

vuthede 31 Oct 30, 2022
This project converts your human voice input to its text transcript and to an automated voice too.

Human Voice to Automated Voice & Text Introduction: In this project, whenever you'll speak, it will turn your voice into a robot voice and furthermore

Hassan Shahzad 3 Oct 15, 2021
A Non-Autoregressive Transformer based TTS, supporting a family of SOTA transformers with supervised and unsupervised duration modelings. This project grows with the research community, aiming to achieve the ultimate TTS.

A Non-Autoregressive Transformer based TTS, supporting a family of SOTA transformers with supervised and unsupervised duration modelings. This project grows with the research community, aiming to achieve the ultimate TTS.

Keon Lee 237 Jan 2, 2023
A Chinese to English Neural Model Translation Project

ZH-EN NMT Chinese to English Neural Machine Translation This project is inspired by Stanford's CS224N NMT Project Dataset used in this project: News C

Zhenbang Feng 29 Nov 26, 2022
Implementation of Natural Language Code Search in the project CodeBERT: A Pre-Trained Model for Programming and Natural Languages.

CodeBERT-Implementation In this repo we have replicated the paper CodeBERT: A Pre-Trained Model for Programming and Natural Languages. We are interest

Tanuj Sur 4 Jul 1, 2022
Final Project Bootcamp Zero

The Quest (Pygame) Descripción Este es el repositorio de código The-Quest para el proyecto final Bootcamp Zero de KeepCoding. El juego consiste en la

Seven-z01 1 Mar 2, 2022
Simple NLP based project without any use of AI

Simple NLP based project without any use of AI

Shripad Rao 1 Apr 26, 2022