Giter Site home page Giter Site logo

Comments (11)

scottrbrtsn avatar scottrbrtsn commented on September 17, 2024 2

fysa it appears that open-dis-python requires numpy which requires python 3.9 per: #50 (comment)

from open-dis-python.

ngjunsiang avatar ngjunsiang commented on September 17, 2024 1

Assuming there is no major prior use of open-dis-python that needs backward compatibility to be supported, I would recommend the following minimum versions:

Python 3.5

This is the earliest version that supports type annotations in functions and methods. This would make the code more readable and easier to understand at a glance, especially for those used to type specifications from Java and C++

Annotated functions, before and after

image
image

Python 3.7

This is the earliest version that introduces dataclasses and the dataclass decorator and field object. The dataclass decorator uses type annotations on class attributes and uses them to provide default __init__() and __repr__() behaviour, which make introspection much easier with less code.

Before dataclass

image
image

After dataclass (with type annotations)

image
image

from open-dis-python.

leif81 avatar leif81 commented on September 17, 2024 1

@ngjunsiang It's difficult to know what version of Python users of the library are using.

I see that Python 3.5 was released in 2015 and Python 3.7 in 2018. And based on W3 stats for Python 3 (I'm not sure if these are the best stats) I see the following use in the Python 3 community:

  • 1.2% of users are using a version older than 3.5.
  • 33.8% of users are using a version older than 3.7.

Based on those stats, we may alienate up to 1/3 of the users by upgrading to 3.7 today, whereas almost no one would be impacted by updating to 3.5. On this info alone, I would suggest setting the base version to 3.5.

Two questions for the open-dis-python community. Lets leave this question open for a week to collect feedback.

  1. Are you using a version of Python older than 3.5?
  2. Would you be able to upgrade your application to Python 3.5?

from open-dis-python.

scottrbrtsn avatar scottrbrtsn commented on September 17, 2024 1

Didn't think of this option:
pip install git+https://github.com/open-dis/open-dis-python works as is until a package is created in the global pypi.

from open-dis-python.

leif81 avatar leif81 commented on September 17, 2024

@ztolley yes that was my intent. I tried a while back and hit a snag, maybe it's time I retry.

from open-dis-python.

ngjunsiang avatar ngjunsiang commented on September 17, 2024

Could I check what is the oldest version of Python 3 this package would be intended to support?

from open-dis-python.

leif81 avatar leif81 commented on September 17, 2024

@ngjunsiang i'm not sure how to determine that

from open-dis-python.

ngjunsiang avatar ngjunsiang commented on September 17, 2024

I am asking primarily because this would determine the main style and syntax to be used (e.g. class DataQueryDatumSpecification( object ): is required by Python2, but Python3 only requires class DataQueryDatumSpecification:)

Secondarily, Python3 versions 3.7 and up add new syntax features that might not be supported in earlier versions. E.g. dataclasses are only available for version 3.7, and would need an external import for support in 3.6 and earlier.

I noted that the README states this is a Python 3 implementation of DIS 7, so I assume this is not meant to be backward-compatible with any Python version earlier than 3.0. I am trying to determine which newer Python features I can use if I want to make any pull requests.

Furthermore, if packaging work is to be done, the Python requirement needs to be stated in pyproject.toml (with reference to the Python Packaging User Guide). I can help with this work when my commitments free up somewhat in the second half of this year. But I don't know how to begin finding out where open-dis-python is already being adopted, so as to avoid breaking backward compatibility with those projects if they switch to a pip-based install instead of building from source.

from open-dis-python.

scottrbrtsn avatar scottrbrtsn commented on September 17, 2024

Maybe consider a pyproject.toml?
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/

for enabling poetry-like integrations: https://python-poetry.org/docs/pyproject/

from open-dis-python.

scottrbrtsn avatar scottrbrtsn commented on September 17, 2024

This issue would make installing to Dockerfiles much easier also. I'm wondering if a docker swarm/k8s example would be worth the effort?

from open-dis-python.

leif81 avatar leif81 commented on September 17, 2024

@scottrbrtsn good catch. If we're already dependent on 3.9+ then we might as well stay with that baseline version.

from open-dis-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.